未修饰的JDialog边框

未修饰的JDialog边框

本文介绍了未修饰的JDialog边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用Metal L&F的未经装饰的JDialog周围的边框有疑问.

I have a question regarding the border around an undecorated JDialog using the Metal L&F.

查看此图片以查看此窗口上的边框:

Look at this picture to see the border that is on this window:

我试图弄清楚如何消除或更改JDialog外部的蓝色边框的颜色.我查看了Look & Feel的UI默认值,但是我无法提出任何适用于此的方法.

I'm trying to figure out how to either get rid of or change the color of the blue border around the very outside of the JDialog. I looked at the UI defaults for the Look & Feel but I wasn't able to come up with any that worked for this.

有人对摆脱边界有任何想法吗?

Does anybody have any ideas on how to get rid of that border?

谢谢!

推荐答案

您需要更改根窗格的Border:

getRootPane().
   setBorder( BorderFactory.createLineBorder(Color.RED) );

这篇关于未修饰的JDialog边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-02 02:31