A project I'm working on has this awful problem wherein the JFrame refuses to resize in Linux. I've tried the setResizable(true) method, both in the constructor and outside of it, but no go. It works fine on Windows. And I'm using Java 1.6 if that makes any difference. Am I just forgetting something stupid?

/* from main() */
ITSUCSFrame jf = new ITSUCSFrame();
/* from constructor */
// the next line is to make it larger than a handful of pixels :(
setMinimumSize(new Dimension(800,600));

I found a fix, figured I'd post if anyone comes across the thread later. The problem was that there was a line in the frame constructor:

setMaximizedBounds(new Rectangle(0,0,0,0));

This keeps the max size pretty small. Only reason I could see the app was because of a setMinimumSize() call elsewhere in the code. The setMaximizedBounds line was added by the NetBeans GUI editor thingy (my partner did that part of it, so I didn't know about that line till I stumbled on it). And yet another reason why I can't stand WYSIWYG editors...

This article has been dead for over six months. Start a new discussion instead.