Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have many jPanel (panelF) that are added in other jPanel(panelB). jPanelF contain jPanelC. enter image description here

I have set the layout to add them as follows:

    PanelB.setLayout(new BoxLayout(this.PanelB, BoxLayout.PAGE_AXIS));
    PanelF panelF1 = new PanelF(); 
    PanelB.add(panelF1);
    PanelF panelF2 = new PanelF(); 
    PanelB.add(panelF2);

I set visible false in jPanelC1. But JPanelF2 preserves distance and not want to make that blank space

enter image description here What I want is that when disappearing JPanelC1. Distance is maintained between the jPanelF and not be a white space. I tried validate() and change the layout but I fail. What would be the way? Thank you very much. Sorry for my English

know if there are something like $("#panelC1").fadeOut("slow")? would be ideal.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
465 views
Welcome To Ask or Share your Answers For Others

1 Answer

Invoking panelC1.setVisible(false) makes panelC1 invisible, but it doesn't change the geometry defined by the get[Preferred|Maximum|Minimum]Size methods. You can


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...