• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

How to set the jInternalFrame to be disable?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Would you like to try a free sample? Today we are featuring tiny ads:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic