更改EmptyBorder空间颜色 [英] Change EmptyBorder space colour

查看:112
本文介绍了更改EmptyBorder空间颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道是否有可能更改BorderFactory.createEmptyBorder()方法提供的空白区域的颜色.默认情况下,它始终将其设置为白色-我想将其设置为JFrame背景的任何颜色(即灰色).

Does anyone know whether its possible to change the colour of the empty space provided by the BorderFactory.createEmptyBorder() method. By default it always sets it to white - i want to set it to whatever colour the background of my JFrame is (i.e. grey).

推荐答案

您想要一个带有颜色的空边框吗?空边框的意义是不占用空间.没有空间的东西不能有颜色.您想要线条边框吗?

You want an empty border that has a color? The point of an empty border is that it takes up no space. Something with no space can't have a color. Did you want a line border instead?

请参见 BorderFactory#createLineBorder(颜色)

这篇关于更改EmptyBorder空间颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆