got some problems.
Built an applet that has to be used step-by-step. After each step, a button is clicked and the next step should be added into the GUI.
Problem: without zooming, the added content doesn’t get visible. in a application you can workaround with scaling the window size, but in an applet I wasn’t able to solve that problem.
Thanks
EDIT:
actually, it looks smth like this:
Panel cp = new Panel(new GridLayout(0,2));
Panel Block1 = new Panel(new GridLayout(2,2));
Panel Block1 = new Panel(new GridLayout(2,2));
...
init
public void init()
{
buildBlock1();
buildBlock2();
add(cp);
cp.setVisible(true);
}
adding some empty panels here, those who will get filled afterwards
private void buildBlock1()
{
Block1.add(panel1);
Block1.add(panel2);
Block1.add(panel3);
Block1.add(panel4);
cp.add(Block1);
}
button actionlistener
private void generatePanel1()
{
//adding some Components to the subpanel of Block1, which is a subpanel of cp.
Panel1.add(...);
cp.repaint();
cp.validate();
}
Now I don’t have any code that I can check but adding (and removing) components to a container normally often needs to be “validated”. So try
API docs for
JComponent.revalidate():