Is dynamic JFrame resizing posible?

hi, i'm from germany, so sorry for my bad english.

i've made an jframe with several jlabels with images and so at size 300,456.

the jframe is not resizable and undecorated, so i made an image at the top to be my pseudo header.

the header size is about 30.

what i want is following:

if the user klicks on my button the jframe should "roll-up", so it ends at size 300,30.

i tried it with a for statement and it works fine, BUT all images and components were not displayed during resizing, this looks bad.

when i display an awt label first on the contentpane and give it a background ot text, this is shown during resize, but an awtlabel isnt capable of conaining an image, if it were i would make a screenshot with the robot for "fake"-showing the frame while resize.

And badly all swing components are not shown during resize, so a jlabel-image is not displayed.

can someone help me please?

can i use a pseudo-trick for doing this?

perhaps has someone an other solution than mine?

mfg eripsa

[1071 byte] By [eripsaa] at [2007-11-26 21:28:23]
# 1

This may or may not help you but I always found GroupLayout helpful when laying out Components on a JFrame.

http://weblogs.java.net/blog/tpavek/archive/2006/02/getting_to_know_1.html

The url above gives a good tutorial in how to use it. Rather than specifying exact sizes and screen locations, you place them in a relative horizontal and vertical layout so no matter what kind of screen size, they will always be in position in relation to each other.

On another note...

You might now want to add AWT components to Swing components. They don't work well together.

maple_shafta at 2007-7-10 3:08:52 > top of Java-index,Java Essentials,Java Programming...
# 2

Here's a trick: have two separate windows (large and small). Only one is visible at any time. To roll up, make the large window invisible and the small window visible.

The real Swing expert would no doubt have a better solution. But they answer questions in the Swing forum. It would have been better for you to ask a Swing question there.

DrClapa at 2007-7-10 3:08:52 > top of Java-index,Java Essentials,Java Programming...
# 3
thanks, the idea with the 2 frames is ok, but then i dont have the roll-up-effect?i tried to ask my queszion in the swing forum, perhaps they have a solution, when they are so good as you said!!!!THANKS!
eripsaa at 2007-7-10 3:08:52 > top of Java-index,Java Essentials,Java Programming...