Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set the jInternalFrame to be disable?  RSS feed

 
wei ning
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have created a jFrame including a jDesktopPane and 2 jInternalFrame. The 2 jInternalFrame are named as jInternalFrame1 and jInternalFrame2 and they are placed on the jDesktopPane. Once the project is executed, the jInternalFrame1 is visible, by the way, the jInternalFrame2 will be set to invisible. Then, if i click a button on jInternalFrame1, the jInternalFrame2 is set to be visible. By the way, I would like to disable the jInternalFrame1 to be accessed by user at the same time the jInternalFrame2 is set to be visible. I have tried the code jInternalFrame1.setEnabled(false); , but it can't work, I still can click on jInternalFrame1. I have also tried the code jInternalFrame1.setSelected(false); , but also can't work. Can anyone help me? Thanks...

below is part of that my code

OR



Thanks,
Ning
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The selected iframe is the one with the highlighted title bar, and that is not what you want here.

In Swing, when you c.setEnabled(false) a Container, it doesn't disable the children of the container, as you might expect. The only way to have all components in a container disabled is to recursively go through it disabling all the components found.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!