Java Pack No Resize

Posted by ikurtz on Stack Overflow See other posts from Stack Overflow or by ikurtz
Published on 2010-04-14T16:55:47Z Indexed on 2010/04/14 17:03 UTC
Read the original article Hit count: 133

Filed under:
|
|
|

i am learning Java at the moment and have the following question:

i am adding my controls to JFrame and then pack() before displaying.

this runs the application and all is very nice.

i was wondering is there a way to stop the user from resizing the application window?

also is there a way to for the image in JLabel to expand as the user changes the application window?

at the moment i have it as:

    constraints.fill = GridBagConstraints.BOTH;
    constraints.anchor = GridBagConstraints.CENTER;

and it only centers the image, i would like to be able to expand/shrink the image.

thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about no