Results 1 to 1 of 1
- 06-18-2011, 12:37 PM #1Member
- Join Date
- Sep 2009
- Rep Power
frame changes size even tho i told it not to :D
Hello. I have a frame which contains a container. that container is set to use the borderlayout layout. this container has 4 panel in it each with it's own components. i havent set any size related restrictions on the frame or what's in it.
one panel has a button. when i press it, an event takes place. the result forces the frame size to become bigger due to the output presented in the frame. i tried using frame.setsize but that didnt work. i added setResizable to false and that didnt work either. i even tried using setmaximumsize. nothing. i tried setmaxbounds or setbounds but tht didnt work. for its parameters i put 0,0,650,400. i assumed 00 means the entire frame would be set. so no luck so far. can someoen tell me why plz?
i only used frame.pack twice. the first was when in the constructor when i initiated the frame andwhts in it. the second time is when the output would come out. apparently if i didnt add it the second time, the output wouldnt be presented. nothing would appear. the frame size wouldnt even change.
PS. I FIXED IT. i used frame.setPreferredSize and it worked. even when i pressed the button, it didnt change. WHY? can someone plz explain to me why none of the other methods worked. preferred pawned max? preferred pawned setresizable? :O
Last edited by wildheart25c; 06-18-2011 at 12:45 PM.
- By justbeller in forum AWT / SwingReplies: 4Last Post: 01-18-2011, 09:22 AM
- By koushikG in forum AWT / SwingReplies: 4Last Post: 11-12-2010, 05:25 AM
- By Yoruichi in forum AWT / SwingReplies: 5Last Post: 04-22-2009, 04:37 PM
- By SANDY_INDIA in forum AWT / SwingReplies: 1Last Post: 08-16-2008, 12:51 PM
- By impact in forum New To JavaReplies: 7Last Post: 05-02-2008, 11:57 AM