как вызвать jdialog из jinternalframe - PullRequest
3 голосов
/ 29 ноября 2010

Может кто-нибудь сказать мне, как вызвать JDialog с 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

}
}

это то, что у меня сейчас есть. Я вставил только самые важные строки кода.

Ответы [ 2 ]

1 голос
/ 09 июня 2016

попробуйте этот код

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

customer_registration - это другой jdialog

1 голос
/ 30 ноября 2010

Похоже, вы уже это называете? Вы просто пытаетесь сделать это видимым?


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


Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...