Search code examples
javalook-and-feelshowdialog

showInputDialog Formatting


I'm trying to figure out Java's JOptionPane.showInputDialog look and feel, more specifically, the commented line below:

final JDialog dialog = new JDialog();
    dialog.setAlwaysOnTop(true);  
 // OptionPane.background("blue");
    JOptionPane.showInputDialog(dialog, "Dialog");

How do I correctly use that line?


Solution

  • you should try this

    dialog.getContentPane().setBackground( Color.blue );