开发者

java Window class does not dispatch key events?

I have extended the class Window to create the MetroWindow class, which is like the normal Window except that it is looks nicer.

When I add a TextField to it, I hear beep beep when I hit my keyboard and no letters are shown in the TextField. If, instead of extending Window, I extend JFrame, the TextField are able to receive keystrokes correctly.

I want to keep extending Window for my UI, 开发者_JS百科but I would like to receive the correct keystrokes on my TextField. How do I do this - dispatch keystroke, create listeners... ?


Sorry for providing an answer to my own question, but In case someone is looking for a solution...

What I did was to extend JFrame instead of Window.

I then set JFrame.setUndecorated(true);

this hides the toolbar which is what I was looking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜