How to disable a container and its children in Swing

后端 未结 6 743
伪装坚强ぢ
伪装坚强ぢ 2020-12-08 16:44

I cannot figure out a way to disable a container AND its children in Swing. Is Swing really missing this basic feature?

If I do setEnabled(false) on a container, its

6条回答
  •  佛祖请我去吃肉
    2020-12-08 16:53

    JXLayer might be what you're looking for, according to this post:

    Wrap your container with the JXLayer and call JXLayer.setLocked(true) after that - all components inside will be disabled

    alt text http://www.java.net/download/javadesktop/blogs/alexfromsun/2007.06.25/LayerDemo.PNG

提交回复
热议问题