Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disabling the JTable

 
Fabricio Sanchez
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
Fabricio
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic