Xadina
asked on
Refresh view of the entire GUI
HI!
I am building an interactive circuit application. The menu bar displays a menu and allows the user to access a number of functions. One of them is:
Refresh view of entire GUI.
I have searched for some code but I didn't find anything.
Can u help pls?
I am building an interactive circuit application. The menu bar displays a menu and allows the user to access a number of functions. One of them is:
Refresh view of entire GUI.
I have searched for some code but I didn't find anything.
Can u help pls?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oh... forgot to add that the 'update()' method is part of the java.awt.Container class and that the 'getGraphics()' method is part of the java.awt.Component class.
> Frame.update( Frame.getGraphics() );
you should not call update (or paint) directly.
you should not call update (or paint) directly.
ASKER
I need to referesh the view of the GUI, cos since the GUI lets the user draw a circuit, at any point he might want to start all over again. so he presses refresh.
Well, i have to do it, even if it doesn't make sense or it will loose me marks in the exam! :-)
Thanks.
Well, i have to do it, even if it doesn't make sense or it will loose me marks in the exam! :-)
Thanks.
> at any point he might want to start all over again.
Sorry misunderstood what you meant by refresh.
It sounds like what you want to do is clear what the user has previously drawn. What you need to do for this depends on how you have implemented your drawing.
Sorry misunderstood what you meant by refresh.
It sounds like what you want to do is clear what the user has previously drawn. What you need to do for this depends on how you have implemented your drawing.
Frame.update( Frame.getGraphics() );
That should repaint everything contained within 'Frame' as well as 'Frame' itself.