您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

在Swing中设置JComboBox的背景

在Swing中设置JComboBox的背景

由于我想让这个颜色应用程序更广泛,所以这是最好的方法

UIManager.put("Combo@R_165_2419@.background", new ColorUIResource(UIManager.getColor("TextField.background")));
UIManager.put("Combo@R_165_2419@.foreground", new ColorUIResource(UIManager.getColor("TextField.foreground")));
UIManager.put("Combo@R_165_2419@.selectionBackground", new ColorUIResource(Color.GREEN));
UIManager.put("Combo@R_165_2419@.selectionForeground", new ColorUIResource(Color.WHITE));

如果要自定义更多(禁用的颜色等),则UIManager属性的此列表可能会很有用:http ://www.rgagnon.com/javadetails/JavaUIDefaults.txt

其他 2022/1/1 18:25:19 有544人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶