Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enabling and disabling component is swing

prashant gour
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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()) ;
System.out.println (mAdjustmentLabel.isEnable()) ;

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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic