swing - Java JPanel expand one panel in BorderLayout -


i have 2 simple jpanels, 1 positioned on top , other on bottom.

now im trying resize top panel take more space (and therefore push bottom panel down)

ive added button listen on call like:

  button.addmouselistener(new mouseadapter() {         public void mousereleased(mouseevent e) {              paneltop.setsize(10, 200);       }     }); 

this how add panels:

add(paneltop, borderlayout.north); add(panelbottom, borderlayout.south); 

any ideas if possible?

my tests not working @ all

you should use setpreferredsize instead of setsize. borderlayout notice , resize panel on next validate().


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -