// 创建修改按钮对象
ModifyButton = new JButton();
ModifyButton.setText("修改");
// 修改按钮设定监听器
ModifyButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
modifyButtonActionPerformed(evt);
}
});
private void modifyButtonActionPerformed(ActionEvent evt) {
这里应该怎么写? 假设有个EditPerform窗体已经建立成功
}
刚开始学JAVA,求高手给写个实例代码
ModifyButton = new JButton();
ModifyButton.setText("修改");
// 修改按钮设定监听器
ModifyButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
modifyButtonActionPerformed(evt);
}
});
private void modifyButtonActionPerformed(ActionEvent evt) {
这里应该怎么写? 假设有个EditPerform窗体已经建立成功
}
刚开始学JAVA,求高手给写个实例代码
应该是这样的,好长时间没有写过SWING了,有点忘了。
通常这两个窗口之间可能还有联系,也许是new EditPerform(this).setVisible(true);
看你怎么设计的了
editPerform.setVisible(true);
{
// 添加化组件
addComment();
}
private void addComment()
{
JPanel panel=new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.RIGHT));
panel.add(addButton);
panel.add(DeleteButton);
panel.add(closeButton);
this.add(panel,BorderLayout.SOUTH);
}
窗口弹出来之后是个空白的,本应该在右下角出现三个BUTTON的