Microsoft Visual J++. Java


- 2


if(fAllLoaded)

repaint();

 

// ,

// imageUpdate

return !fAllLoaded;

}

// -------------------------------------------------------

// paint

// paint,

// -------------------------------------------------------

public void paint(Graphics g)

{

//

Dimension dimAppWndDimension = size();

//

g.setColor(Color.white);

//

g.fillRect(0, 0,

dimAppWndDimension.width - 1,

dimAppWndDimension.height - 1);

 

//

g.setColor(Color.black);

 

//

g.drawRect(0, 0,

dimAppWndDimension.width - 1,

dimAppWndDimension.height - 1);

 

if(fAllLoaded == false)

{

//

g.drawString(", ...",

20, dimAppWndDimension.height / 2);

}

 

//

g.drawImage(BkgImg, 1, 1,

dimAppWndDimension.width - 2,

dimAppWndDimension.height - 2, this);

}

}

4.6 HTML, .

4.6. DrawImageObserver\DrawImageObserver.html

<html>

<head>

<title>DrawImageObserver</title>

</head>

<body>

<hr>

<applet

code=DrawImageObserver.class

id=DrawImageObserver

width=320

height=240 >

</applet>

<hr>

<a href="DrawImageObserver.java">The source.</a>

</body>

</html>