Microsoft Visual J++. Java


- 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_NotifyTaskThread == null)

{

// ,

// ,

//

m_NotifyTaskThread = new NotifyTask(m_DrawRectThread);

m_NotifyTaskThread.start();

}

}

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

// stop

// ,

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

public void stop()

{

if (m_DrawRectThread != null)

{

m_DrawRectThread.stop();

m_DrawRectThread = null;

}

 

if (m_NotifyTaskThread != null)

{

m_NotifyTaskThread.stop();

m_NotifyTaskThread = null;

}

}

}

 

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

//

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

class DrawRectangles extends Thread

{

//

Graphics g;

 

//

Dimension dimAppWndDimension;

 

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

// DrawRectangles

// DrawRectangles

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

public DrawRectangles(Applet Appl)

{

//