• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Enabling and disabling component is swing

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am working on table and using combo box in one cell of table and on selection of item of combo box doing enable one another combo and label. That is all in itemStateChanged method. When I launched the dialog first time that is working fine but when I re launch that dialog and makes a selection component does not get enabled and disabled.

Doing following code:

public void itemStateChanged(ItemEvent e)
{
System.out.println (mAdjustmentLabel.isEnable()) ;
mAdjustmentLabel.setEnabled(true);
System.out.println (mAdjustmentLabel.isEnable()) ;
mAdjustmentCombo.setEnabled(true);
updateUI();
}

First print statement shows false because by default that is disable.
Second statement shows True. But UI does not get updated, componets remain on their prevoius state.

So I am facing very strange condition if any body have any idea please share with me.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic