Note that there are some explanatory texts on larger screens.

plurals
  1. POProgram not repainting upon JFrame height maximizing
    primarykey
    data
    text
    <p>You can resize JFrame with mouse dragging in several ways:</p> <ol> <li>You can resize it's height (top/bottom edge)</li> <li>You can resize it's width (left/right edge)</li> <li>You can resize both (in corners)</li> <li>You can maximize it by dragging the whole window to the monitor top edge</li> <li>You can maximize it's height by dragging it's top/bottom edge to the top/bottom edge of the monitor</li> </ol> <p>My program is being repainted on every one of this actions except the number 5.</p> <p>Why is that?</p> <p>Could that be bug in my program? It doesn't seem so. I don't know where would I put repaint request for that particular case... It seems that JFrame itself should call repaint on it's contentPane after each resize, right?</p> <p>It smells like a bug in Java itself, in JFrame class.</p> <p>SSCCE:</p> <pre><code>import javax.swing.JFrame; import javax.swing.SwingUtilities; class Gui { Gui() { JFrame masterWindow = new JFrame("My very own SSCCE"); masterWindow.setSize(1100, 100); masterWindow.setLocationRelativeTo(null); masterWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); masterWindow.setVisible(true); } } class Main { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new Gui(); } }); } } </code></pre> <p>Grab the top edge of the JFrame and drag it to the top edge of the screen and release. Bottom extended part should be pitch black. If you then maximize it, it will all be grey, as it should.</p> <p>I still say it's Java or Windows bug.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload