简体   繁体   English

在Apache Pivot中使用Application.UnprocessedKeyHandler的示例是什么?

[英]What is an example of the use of Application.UnprocessedKeyHandler in Apache Pivot?

What is an example of the use of Application.UnprocessedKeyHandler in Apache Pivot? 在Apache Pivot中使用Application.UnprocessedKeyHandler的示例是什么? I've checked Google and the Pivot docs and see no examples, and the Javadoc isn't enlightening. 我检查了Google和Pivot文档,没有看到任何示例,并且Javadoc没有启发性。 There's a tease of sample code in the mailing list archives , but the code attachment is not available. 邮件列表档案中有一些示例代码,但是代码附件不可用。

Thanks! 谢谢!

The answer is really simple, the Javadoc confused me for some reason. 答案真的很简单,Javadoc出于某种原因使我感到困惑。 Just add the UnprocessedKeyHandler interface to whatever class in the project is implementing org.apache.pivot.wtk.Application , and then of course implement in that class the methods from the interface. 只需将UnprocessedKeyHandler接口添加到项目中正在实现org.apache.pivot.wtk.Application任何类中,然后当然可以在该类中实现该接口中的方法。

A start of an example would be to take, say: 一个例子的开始就是说:

public class HelloWorld implements Application

And change it to: 并将其更改为:

public class HelloWorld implements Application, UnprocessedKeyHandler

The thread that led to this solution can be found here . 导致此解决方案的线程可以在这里找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM