Hello again,
some days ago I stumbled about a “funny” behaviour when displaying a simple dialog on top of a CGrid. Please see this little demo:
private static JFrame frame;
public static void main(String[] args) {
frame = new JFrame("title");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
CControl control = new CControl(frame);
CContentArea contentarea = control.getContentArea();
DefaultSingleCDockable d1 = new DefaultSingleCDockable("d1", "d1");
d1.addAction(new DialogButton());
CGrid grid = new CGrid(control);
grid.add(0, 0, 1, 1, d1);
contentarea.deploy(grid);
frame.add(contentarea);
frame.setBounds(500, 250, 500, 500);
frame.setVisible(true);
}
public static final class DialogButton extends CButton {
public DialogButton() {
this.setShowTextOnButtons(true);
this.setText("Show Dialog");
}
@Override
protected void action() {
//JOptionPane.showMessageDialog(frame, "Dialogs are super.");
JOptionPane.showMessageDialog(null, "Dialogs can be funny.");
}
}
When pressing the CButton “Show Dialog” the dialog appears completely normal, when giving a parent paramter (“frame”). Being lazy and setting it to “null” the dialog appears vibrating on and off for about 10 times.
Any comments on this ???
Thanks Thilo