Color of JOptionPane border

佐手、 提交于 2019-12-25 05:27:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!