0

Iam using applet for an application. In that when ever a conditin satifies,it has to call the paint method again. Is this possible with repaint method?? or any other methods to follow..?? I tried something like this,

if(j==0){
     ready_status=true;
     repaint();  // i want paint has to call again here      
  }
RAVITEJA SATYAVADA
  • 2,503
  • 23
  • 56
  • 88

1 Answers1

-1

Try this

paint(getGraphics()); 
Rasel
  • 15,499
  • 6
  • 40
  • 50
  • 1
    `paint(getGraphics());` This has a bad smell. One should never call `paint(Graphics)`. This is not a fix so much as a 'kludge' - likely to break on any other machine. – Andrew Thompson Jun 15 '12 at 05:02
  • 1
    I agree - you should *not* be calling "paint()"! – paulsm4 Jun 15 '12 at 05:50
  • You are right.Its not recommended.I should have said that.Just showed how he can call paint if he wants – Rasel Jun 15 '12 at 05:58
  • *"Just showed how he can call paint if he wants"* Is 'he' programming only for 'his' eyes? Generally not, so an approach that is 'likely to break on any other machine' is not something you should be including in an answer - for whatever reason. If the OP asked how to shoot themselves in the foot, would you give them instructions? – Andrew Thompson Jun 15 '12 at 06:36