OK, I have a JFrame whose dimensions had to be constrained on resize. Basically, it has to grow equally in width and height (think Checkerboard). In order to do that, I had to override the JFrame’s setBounds. However, I had no idea how to apply this same behavior when teh Frame is maximized. When maximized, the Frame would simply blow up and fit the entire screen. Well, it turns out that the same way setSize has been deprecated, setMaximiumSize – although not deprecated, it’s ignored for Frames. So use setMaximizedBounds.
Rectangle bounds = getGraphicsConfiguration().getBounds();
int minOfSizes = (int) Math.min(bounds.getWidth(), bounds.getHeight());
setMaximizedBounds(new Rectangle(new Dimension(minOfSizes, minOfSizes))); // viola!
how dare they intro a method i’ve not heard off since the last time i used Swing in 1998.. those bastards..