问题
How might I go about changing the color of a JOptionPane's border
?
Here is a screenshot of the border I am talking about:
That blue border is what I am trying to get rid of.
I tried to set UIManager.put("OptionPane.border", new BorderFactory...)
for LookAndFeel but that changed the inside border, not the outermost one.
I need to get rid of that blue border.
Any ideas?
-Mark
回答1:
Read the JOptionPane API
. It shows you how to create a JOption pane manually so that you have access to the JDialog. Once you have the JDialog you can remove the Border the same way you did in your last question:
Undecorated JDialog border
回答2:
I have research on it these days, finally I found this code may help you!
UIManager.put("RootPane.frameBorder", new LineBorder(Color.red));
UIManager.put("RootPane.dialogBorder", new LineBorder(Color.red));
UIManager.put("RootPane.errorDialogBorder", new LineBorder(Color.red));
回答3:
In LaF section there is the initialization of ShadowPopupBorder
which used for tooltips, popups, and modal dialogs borders. So check if it is used around your software
来源:https://stackoverflow.com/questions/17452235/color-of-joptionpane-border