选择后的Java JComboBox内部虚线边框 [英] Java JComboBox inner dotted border after select

查看:44
本文介绍了选择后的Java JComboBox内部虚线边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 ComboBox 中选择某些内容后,我想删除内部虚线边框.

I want to remove that inner dotted border after select something from ComboBox.

我试过了

UIManager.put("ComboBox.focus", new Color(0,0,0,0));

但不工作.如何删除该边框?

but not working. How can remove that border?

推荐答案

你能试试这个吗?希望能帮到你

can you give this one a try ? I hope it helps

combobox.setBorder(new EmptyBorder(0, 0, 0, 0));

如果你想移除焦点(我认为你提到的虚线边框可能是焦点在小部件上的结果)你可以使用getNextFocusableComponent() 和 requestFocusInWindow()

if you want to remove focus (i think dotted border you mention can be result of focus on widget) you can use getNextFocusableComponent() and requestFocusInWindow()

这篇关于选择后的Java JComboBox内部虚线边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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