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