I want to set the maximum JFrame size at application startup time. The problem is that if the screen resolution is larger, my frame becomes larger, but at that time it should not cross the specified maximum range, but the same case works fine with low resolution.
How I want my frame to be maximum (500 500), so I wrote this piece of code:
JFrame frame = new JFrame("FRAME TRANSPARENT");
frame.setSize((int)(Toolkit.getDefaultToolkit().getScreenSize().getWidth()-50), (int)(Toolkit.getDefaultToolkit().getScreenSize().getHeight()-150));
frame.setMaximizedBounds(new Rectangle(0,0 , 500, 500));
frame.setVisible(true);
Even I installed Bound, the JFrame considers the setSize method and it seems to ignore the setMaximizedBounds method. I already tried the setMaximumized method, but got the same result.
source
share