buttonPanel.add(Box.createHorizontalStrut(5));
buttonPanel.add(cancelButton);
buttonPanel.add(Box.createGlue());
content.add(buttonPanel, BorderLayout.CENTER);
dialog.setSize(300, 100);
dialog.show();
}
public static void main(String[] args) {
TestJDialog frame = new TestJDialog();