aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Disabling the JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Disabling the JTable" Watch "Disabling the JTable" New topic

Disabling the JTable

Fabricio Sanchez
Ranch Hand

Joined: Mar 11, 2003
Posts: 33
Hi there,
I hope this is a quick one...
I would like to mimmic the way a button is disabled in swing (i.e. it goes a darker shade of grey and processes no event) in a JTable. I like the changing of the color as it lets the user know that he can't use the component.
In my JTable instance called table, I have tried to

But that only disables table selection events and does not change any colour (that is, it still looks active to me).
What can I do to get the disabled look I want?
Do I have to set the backgroud colours myself to gray(disbaled) then back to white(enabled) again?
Do I have to remove listeners and then add them again? (For example I have a mouseListener placed on the table column header that I would like to disable also).
Thank you!
Don't get me started about those stupid light bulbs.
subject: Disabling the JTable