Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

simple problom  RSS feed

 
daniel desouza
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am calling repaint() method 2 times in my applet.
in each call,i want to erase formally drawn things.
how to achieve this?.
now it's overlapping.i just wanna erase formally drawn things from my applet before drawing new.
thanks in advance
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know if it is the recommended solution, but you could use
 
daniel desouza
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that will not solve the problom.i want to erase all previous drawings before new drawing.i think it's simple.i am new to java.anyone please help me.
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The above method works for me using a JComponent. I don't know a whole lot about applet programming. Maybe you could post some code?
 
daniel desouza
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it's sloved !! by little stranger method
i changed JApplet to Applet ..Now OK
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.
For a JComponent you will need paintComponent(Graphics)
How Swing components are displayed from the java Tutorial.
 
Rafael Repolho
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Strange Method that you found out to solve your problem is simple, by taking the "J" out from the beggining of the word you stopped using Swing and started using AWT.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!