• Post Reply Bookmark Topic Watch Topic
  • New Topic

clearing a panel  RSS feed

 
Greg Levine
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a program that parses and XML file and displays the graphics associated with the commands in the XML file onto a panel. The panel is always square and is considered to be a coordinate system with extremes of x=+-1 and y=+-1. When the window is resized the panel is also resized and the graphics are normalized to fit in the newly sized panel. The XML file is entered through a textfield and parsed once the load button is clicked.

So, my problem is that everytime a new url is entered into the textfield and the load button is clicked, I want to clear the graphics from the panel, as if to start from scratch. So from the class that implements the load button action listener, I call a clear function that resides in the class that contains all of the GUI code. I stored the graphics in Vectors in the GUI class so that I could repaint the graphics when necessary. When the clear function is called, these Vectors are cleared and repaint is called so that the panel can be redisplayed as a blank panel. The problem though, is that this isn't happening. None of the graphics are being erased. Please help.

My code can be found at this location:
http://filebox.vt.edu/users/glevine/Project1/noclear/

Two XML files to test with can be found at these locations:
http://filebox.vt.edu/users/glevine/Project1/design.xml
http://filebox.vt.edu/users/glevine/Project1/circles.xml
 
Greg Levine
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
forget it, i forgot that i was storing the same data in two places
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!