【发布时间】:2011-11-26 07:58:27
【问题描述】:
当JButton 被添加到内容窗格时,我们可以通过双击按钮或右键单击->事件->操作->actionPerformed来设置操作。假设我们设置了某事发生。然后我们需要删除那个函数。这可以通过删除我们在那个按钮的actionPerformed中编写的代码来轻松完成。但问题是,该按钮的 actionPerformed 方法仍然存在,即使它不再使用且不需要了。
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
//no function here.. but this code is still remaining. need to remove this code part as well
}
如何删除?我以 JButton 为例。其他组件的action方法是这样的。
【问题讨论】:
标签: swing netbeans desktop-application