Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why showStatus is effective only in paint method

 
abhay jain
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why showStatus() is effective only in paint method ( not in start() and init() and why than setBackground() gives effect in all methods ?? )
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the code that makes you believe that that is the case (please make it an SSCCE).
 
abhay jain
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.applet.*;
import java.awt.*;

/*

<applet
code=Helloj
width=200
height=200 >
</applet>


*/


public class Helloj extends Applet
{

public void start()
{
setBackground(Color.red);

}
public void paint (Graphics e)
{

showStatus("hi all");
e.drawString("hi all",10,10);

}

}



// on putting "showStatus("hi all");" in start() it gives no effect
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic