关于键盘事件焦点问题?
pqds 2003-08-23 04:27:48 http://expert.csdn.net/Expert/topic/2079/2079512.xml?temp=.3699304
mvc框架
应该还是焦点没有获取!
在Frame中!
//getContentPane().add(toolBar, BorderLayout.NORTH);
还有加入视图的语句!
如果去掉toolBar,只加视图就运行正常,但是两个都加!则不能运行键盘事件!
简单说就是!
就是在一个Frame中加入了JComponent(内有键盘事件),和3个JToolBar
如果不加JToolBar(只有JComponent)则程序正常!
否则键盘事件不执行,但同时鼠标事件一直运行正常!