2015-06-01 48 views
1

我想弄清楚Java的JOptionPane.showInputDialog外觀和感覺, 更具體地說,下面的註釋行:showInputDialog格式化

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

如何正確使用這條線?

+0

請註明答案一旦其已經幫助您的解決方案。 – user3337714

回答

2

你應該試試這個

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

JOption窗格看到這個http://stackoverflow.com/questions/9064943/how-to-change-background-color-of-joptionpane – Cris

+0

謝謝。我會看一看。 –