Click here to Skip to main content
15,911,360 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to refresh JFrame or JPanel in java swing ?
or how can i refresh my gui in java swing ?
Posted

Check out this Stack Overflow question: "how do I refresh a GUI in Java?"[^].
 
Share this answer
 
If you check the JavaDoc for Swing/AWT, specifically the repaint method of the Component class (found here: http://docs.oracle.com/javase/7/docs/api/java/awt/Component.html#repaint()[^]), you will see that calling this method will tell Java to repaint the component at its next opportunity. Since a JFrame is a component, this method can also be called on your JFrame, or any other Swing component that extends Component (such as JPanel).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900