gpt4 book ai didi

java - 如何从 jinternalframe 调用 jdialog

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:39:35 24 4
gpt4 key购买 nike

有人能告诉我如何从 JInternalframe 调用 JDialog 吗?

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

}
}

这就是我目前拥有的。我只插入了最重要的代码行。

最佳答案

看起来你已经在调用它了?你只是想让它可见吗?


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

关于java - 如何从 jinternalframe 调用 jdialog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4303363/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com