简体   繁体   中英

Java AWT TextField does not get ghosted when disabled on Windows

I have an AWT text field that gets enabled and disabled based on the state of a Checkbox. On OSX when the TextField is disabled it gets ghosted but this does not occur on Windows 7. Is this how it is supposed to work on Windows? Is there a way to get the TextField to become ghosted on Windows. Note: We are doing a little maintenance on some very old code and for compatibility we must use AWT and cannot switch over to swing at this time.

AWT gets look and feel from window manager of operating system.

On OSX disabled AWT text field looks ghosted because OSX window manager makes it look so.

So it wont be possible to bring ghosted effect but will look grayed out using AWT for disabled component on Windows 7.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM