启用/禁用JTextField背景色 [英] JTextField background color on enable/disable

查看:257
本文介绍了启用/禁用JTextField背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在禁用JTextField时,我将其背景颜色更改为黑色.我使用UIManager和此属性TextField.disabledBackground(在应用程序启动时设置)进行此操作.我想知道当再次启用JTextField时如何更改背景颜色吗? 谢谢.

i changed the background color of my JTextField to black when it is disabled. I do this using the UIManager and this property TextField.disabledBackground, that i set at application start up. I would like to know how can i change the background color when the JTextField is enabled again ? Thank you.

推荐答案

看看

Have a look at http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/ Run the webstart app there, or download the code and run that utility yourself. What you want might be "TextField.background", but armed with the list of properties and defaults, you'll find the right one I bet.

这篇关于启用/禁用JTextField背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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