Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Enabling and disabling component is swing  RSS feed

 
prashant gour
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!