views:

31

answers:

2

I have an code that adds jbutton on the clicked place in the jLayeredpane on mouse click. Now the problem is on resize. When i dont change the size of jLayeredpane on runtime there is no problem. When i maximize the window and i have made it as, the jLayeredpane will adjust to fit the screen so when i add a button on the jpane now and when the window size is reduced the buttons i have added is out of range and so it is not displayed. Any solution for this ?

+1  A: 

Yes.. Use Layouts :)

eugener
A: 

The article Laying Out Components in a Layered Pane mentions, "Although a layered pane has no layout manager by default, you can still assign a layout manager to the layered pane."

trashgod