This week's book giveaway is in the Android forum.
We're giving away four copies of Learning Java by Building Android Games and have Jean-Marcel Belmont on-line!
See this thread for details.
Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Solution to Disable a Panel  RSS feed

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have few panels in a JDialog which i need to disable for editing. basically i dont wont to gray-out the components and disable the components, but keeping the components as it is, i wont them to be un-editable, i know that components such as text boxes have that capability, but do other components such as check boxes and radio button have that? and on the other hand the solution which i'm thinking is basically to have a pane on top of the panel i wont to disable something like a glass pane.. will that be possible? or can i put any means of transparent component on top of the panel and control that...
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[EDIT]

ignore the following - it relates only to the subject line, oblivious to this part of the post
"basically i dont wont to gray-out the components and disable the components"

[/EDIT]

maybe iterating the components in an overridden isEnabled() will work, then you just enable/disable the panel (or disable the panel's components in the
actionListener - whichever way suits)

something like this (may need a try/catch around the comp[x].setEnabled)


[ June 14, 2007: Message edited by: Michael Dunn ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!