Click to See Complete Forum and Search --> : Java + Swing: minimum size issue


kmj
06-27-2001, 03:30 PM
You can set a minimum size for a JPanel in swing, which is cool.. but then you can still resize the frame that it's in to a dimension smaller than that size. When this happens the JPanel dissappears. Okay.. Is there some way to then output a message saying the window is too small? Or perhaps is there a way to notice the frame is being resized and set a minimum for the frame? something like that? so that you don't end up with a seemingly empty box if you resize?

Thx.

kmj
06-27-2001, 04:28 PM
Never mind... I found 'ComponentEvent' which informs me when I need to be informed, and just call the pack() method on the frame if the size gets too small. That'll be sufficient for this exercise.