Microsoft Visual J++. Java

zepter zepter

- 2


g.setColor(Color.black);

 

//

g.drawRect(0, 0,

dimAppWndDimension.width - 1,

dimAppWndDimension.height - 1);

}

 

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

// start

//

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

public void start()

{

if (m_DrawRectThread == null)

{

m_DrawRectThread = new DrawRectangles(this);

m_DrawRectThread.start();

}

 

if (m_DrawEllipseThread == null)

{

m_DrawEllipseThread = new DrawEllipse(this);

m_DrawEllipseThread.start();

}

}

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

// stop

// ,

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

public void stop()

{

if (m_DrawRectThread != null)

{

m_DrawRectThread.stop();

m_DrawRectThread = null;

}

 

if (m_DrawEllipseThread == null)

{

m_DrawEllipseThread.stop();

m_DrawEllipseThread = null;

}

}

}

 

// =========================================================

//

// =========================================================

class DrawRectangles extends Thread

{

//

Graphics g;

 

//

Dimension dimAppWndDimension;

 

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

// DrawRectangles

// DrawRectangles

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

public DrawRectangles(Applet Appl)

{

//

g = Appl.getGraphics();

 

//

dimAppWndDimension = Appl.size();

}

 

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