如何在netbeans中打开JDialog表单?

时间:2015-04-17 10:53:59

标签: java netbeans jdialog

我已经构建了Swing GUI的类JDialog form(diglog_promotion)和一个按钮。我想点击按钮时显示JDialog表单,以便我编码

dialog_promotion f = new dialog_promotion();                  
f.setVisible(true);
单击按钮后,它出现错误:

  

不支持YET

我尝试将它用于eclipe它的工作原理 我错了什么?

1 个答案:

答案 0 :(得分:2)

 Inside of your method Actionperformed for any particular case you want call JoptionPane.showMessageDialog(,); with the message you want. I have tried this in netbeans it works.
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt)
{
 ...
 ...
 if(saveisclicked)
{
  System.out.println("Please Fill user name");
  JOptionPane.showMessageDialog(null, "Please Enter  User Name field");

}
...
...