15.01.2013 Views

Programs 1 Develop static pages (using Only HTML) of an online ...

Programs 1 Develop static pages (using Only HTML) of an online ...

Programs 1 Develop static pages (using Only HTML) of an online ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

do<br />

{<br />

try<br />

{<br />

Thread.sleep(interval * 1000);<br />

}<br />

catch(InterruptedException interruptedexception) { }<br />

int j = getSeconds();<br />

ch<strong>an</strong>ges.firePropertyCh<strong>an</strong>ge("seconds", new Integer(i), new Integer(j));<br />

i = j;<br />

} while(true);<br />

}<br />

public void propertyCh<strong>an</strong>ge(PropertyCh<strong>an</strong>geEvent propertych<strong>an</strong>geevent)<br />

{<br />

if(color == Color.red)<br />

{<br />

label.setBackground(Color.or<strong>an</strong>ge);<br />

color = Color.or<strong>an</strong>ge;<br />

} else<br />

if(color == Color.or<strong>an</strong>ge)<br />

{<br />

label.setBackground(Color.green);<br />

color = Color.green;<br />

} else<br />

if(color == Color.green)<br />

{<br />

label.setBackground(Color.red);<br />

color = Color.red;<br />

}<br />

}<br />

private Color color;<br />

private Label label;<br />

private PropertyCh<strong>an</strong>geSupport ch<strong>an</strong>ges;<br />

private int interval;<br />

tr<strong>an</strong>sient Thread runner;<br />

}<br />

TraficLight.mft :<br />

M<strong>an</strong>ifest-Version: 1.0<br />

Name: mypack/TrafficLight.class<br />

Java-Be<strong>an</strong>: True<br />

TraficPerson.mft :<br />

M<strong>an</strong>ifest-Version: 1.0<br />

Java-Be<strong>an</strong>: True<br />

Name: demo/TrafficPerson.class<br />

Created-By: 1.6.0 (Sun Microsystems Inc.)<br />

23<br />

23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!