How to call jdialog from jinternalframe

Can someone tell me how to call JDialog from JInternalframe?

public class BSJFrameUpdateOnlineTrdDlg extends JInternalFrame {

public BSJFrameUpdateOnlineTrdDlg(JDesktopPane jdesk) { //constructor
    super("Backoffice Synchronization");
     jdeskTop = jdesk;
     frame = this;
    try {

      jbInit();
    }
    catch (Exception e) {
      e.printStackTrace();
    }
    setLocation(400, 200);
    setVisible(true);
    setSize(720, 570);

  }
private void jbInit() throws Exception {
//.......
 jButton1.addActionListener(new jButton1_upload_action());
this.getContentPane().add(jButton1, null);

}

 class jButton1_upload_action implements ActionListener{
    public void actionPerformed(ActionEvent e) {
 displayDialog(frame,marketStatus);
}}

 public void displayDialog(JInternalFrame frame,String status){
     JDialog jdg = new JDialog();
     //this is where the JDIalog get initiated

}
}

this is what i have now. I inserted only the most important lines of code.

+3
source share
2 answers

Looks like you already called? Are you just trying to make it visible?


public void displayDialog(JInternalFrame frame,String status){
     JDialog jdg = new JDialog();
     //...add the guts of the dialog
     jdg.setVisible(true);
}


+1
source

try this code

 new customer_registration(null, true).setVisible(true);

customer_registration is another jdialog

+1
source

Source: https://habr.com/ru/post/1777441/


All Articles