Results 1 to 1 of 1
  1. #1
    wildheart25c is offline Member
    Join Date
    Sep 2009
    Rep Power

    Default 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 01:45 PM.

Similar Threads

  1. Replies: 4
    Last Post: 01-18-2011, 09:22 AM
  2. Replies: 4
    Last Post: 11-12-2010, 05:25 AM
  3. Setting frame size to the size of an image
    By Yoruichi in forum AWT / Swing
    Replies: 5
    Last Post: 04-22-2009, 05:37 PM
  4. Prob. with screen resolution and Frame size??
    By SANDY_INDIA in forum AWT / Swing
    Replies: 1
    Last Post: 08-16-2008, 01:51 PM
  5. [SOLVED] How to set the frame size?
    By impact in forum New To Java
    Replies: 7
    Last Post: 05-02-2008, 12:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts