Help with JAVA Swing! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Help with JAVA Swing!

Here is what to do: 1.Launch the code 2.Draw something in the opened window 3.Change the size of the window with the help of your mouse. Just drag the border of your window to make it smaller or bigger. You'll see that all content on the window disappeared. So, my question is: how to make it stay there regardless of whatever happens to the window? Thank you! The code goes here: https://code.sololearn.com/crmdkI9Q7b4x/?ref=app

9th May 2019, 4:04 AM
William
William - avatar
2 Answers
+ 3
If you want to fix this do the following - Constantly Save Graphics Data - Update JFrame / JPanel You can achive this by using BufferedStradegy https://docs.oracle.com/javase/7/docs/api/java/awt/image/BufferStrategy.html
27th May 2019, 9:13 AM
Vanessa Nilsson
0
Skrub Look like great solution! Thanks 👍
28th May 2019, 12:35 AM
William
William - avatar