我有一个有两种形式的项目。第一个是JFrame
,第二个是JInternalFrame
。我制作了第一个类似 MDI 表格的表格。当我单击第一种形式的菜单时,应显示第二种形式并包含大量来自 Ms. Access 2003 数据库的数据。我无法将事件添加到第二个表单,JInternalFrame 中的表单加载在哪里。我尝试用 实现我的第二种形式WindowListener
,但它不起作用。请帮忙 !
问问题
790 次
1 回答
1
From waht I understand, you have a JFrame
that may contain JInternalFrame
and you want a menu item to create a JInternalFrame, isn't it ?
if so, the answer is as simple as a look to the Swing tutorial : How to use menus. what you'll have to do is is to create either an Action or an ActionListener
which actionPerformed(ActionEvent)
method will create the new JInternalFrame and make it visible in your JDesktopPane
.
于 2011-02-08T10:26:53.793 回答