I'm working with the Window Builder plugin for Eclipse.
When I execute the below code it shows the JDialog
correctly. I was expecting the JDialog
to show in the design tab (at design time) as well, but it won't.
package testshowjdialog;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class MyJDialog extends JDialog {
private static final long serialVersionUID = 1L;
public MyJDialog(JFrame parent) {
super(parent, true);
setTitle("A Title");
JButton button = new JButton("Test");
add(button);
setSize(100, 100);
}
/**
* @wbp.parser.entryPoint
*/
public static void main(String [] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
MyJDialog dialog = new MyJDialog(new JFrame());
dialog.setVisible(true);
}
});
}
}
Any idea why?