Hi all,
Do you know how to call new internalFrame after clicking a Jbutton in other internal Frame? As I use MDI, I don't know how to add that new internalFrame to my destop manager ?
Also, Should I use 'AddInternalFrameListener' instead of addActonListener in internalFrame? If yes, what is the method should I use to replace 'actionPerformed'?
Following is part of my coding:
public class lw_SearchPO extends JInternalFrame implements InternalFrameListener, ActionListener{
JButton jButton1 = new JButton();
private void jbInit() throws Exception {
jButton1.setText("Search"
;
jButton1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
void jButton1_actionPerformed(ActionEvent e) {
MainFrame_Pur MainFrame_Pur = new MainFrame_Pur();
lw_updatePO lw_updatePO = new lw_updatePO();
lw_updatePO.addInternalFrameListener(this);
// Can't access desktop even desktop is declared public!
MainFrame_Pur.desktop.add(lw_updatePO);
lw_updatePO.show();
lw_updatePO.pack();
lw_updatePO.setVisible(true);
}
}
Thanks!
Joyce
Do you know how to call new internalFrame after clicking a Jbutton in other internal Frame? As I use MDI, I don't know how to add that new internalFrame to my destop manager ?
Also, Should I use 'AddInternalFrameListener' instead of addActonListener in internalFrame? If yes, what is the method should I use to replace 'actionPerformed'?
Following is part of my coding:
public class lw_SearchPO extends JInternalFrame implements InternalFrameListener, ActionListener{
JButton jButton1 = new JButton();
private void jbInit() throws Exception {
jButton1.setText("Search"
jButton1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
void jButton1_actionPerformed(ActionEvent e) {
MainFrame_Pur MainFrame_Pur = new MainFrame_Pur();
lw_updatePO lw_updatePO = new lw_updatePO();
lw_updatePO.addInternalFrameListener(this);
// Can't access desktop even desktop is declared public!
MainFrame_Pur.desktop.add(lw_updatePO);
lw_updatePO.show();
lw_updatePO.pack();
lw_updatePO.setVisible(true);
}
}
Thanks!
Joyce