So guys, using a JOptionPane
to ask the user if the app should update or not, and after which I get these white bars in the bottom and right sides of my canvas. Tri
I have the same problem you noticed when i use setResizable(false) and pack() method in a JFrame. Here you can find an answer which describes the problem, but i didn't find a solution that works for me.
In my applications i use a sort of "trick" if needed: i check if the contentPane preferred width is equal to his effective width, if not i recall pack() method.
Something like:
for(int i=0;i<5 && contentPane.getPreferredSize().width!=contentPane.getSize().width;i++) frame.pack();
Of course this isn't a really good solution, but it works for me and if you use a parameter to limit the maximum number of times that pack() should occur, you don't risk to block your gui...