将颜色和大小更改为选项框JOptionPane.showInputDialog

时间:2017-06-12 16:41:33

标签: java swing joptionpane

我必须从JOptionPane.showInputDialog更改背景颜色和选项框的大小。可能吗?它包括in this list吗?

enter image description here

1 个答案:

答案 0 :(得分:2)

The are two ways you could try.

The first is using the UIManager and seeing if you can set the background of the JOptionPane that way.

The second is to use JOptionPane with a custom component that is designed to look (and feel) the way you want it, like

Component mySpecialDialog = ... // your dialog panel
JOption.showMessageDialog(null, mySpecialDialog);