Microsoft Visual J++. Java


- 2


 

// -

CDDiskImg = getImage(getCodeBase(), "cd.gif");

 

// MediaTracker

mt.addImage(CDDiskImg, 0);

}

 

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

// 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);

 

//

g.drawString(", ...",

20, dimAppWndDimension.height / 2);

 

// ,

try

{

mt.waitForAll();

}

catch (InterruptedException ex)

{

}

 

//

g.drawImage(BkgImg, 1, 1,

dimAppWndDimension.width - 2,

dimAppWndDimension.height - 2, this);

 

// -

g.drawImage(FloppyDiskImg, 25, 42, 200, 200, this);

 

// -

g.drawImage(FloppyDiskImg, 25, 3, this);

 

// -

g.drawImage(CDDiskImg , 70, 3, this);

 

// -

g.drawImage(CDDiskImg , 115, 3, 40, 25, this);

}

}

4.4 HTML, .

4.4. ImageDrawWait\ImageDrawWait.html

<html>

<head>

<title>ImageDrawWait</title>

</head>

<body>

<hr>

<applet

code=ImageDrawWait.class

id=ImageDrawWait

width=320

height=250 >

</applet>

<hr>

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

</body>

</html>