Thread View: pl.comp.www
1 messages
1 total messages
Started by mno... Marcin Nowak
Tue, 16 Apr 1996 00:00
Re: Zegarek w JAVIE
Author: mno... Marcin Nowak
Date: Tue, 16 Apr 1996 00:00
Date: Tue, 16 Apr 1996 00:00
102 lines
2492 bytes
2492 bytes
Oto zrodlo :
/* (c) Marcin Nowak */
import java.util.*;
import java.applet.*;
import java.awt.*;
public class zegar2 extends java.applet.Applet implements Runnable{
int Godz, Min, Sek, Poprzed;
Thread killme = null;
boolean threadSuspended = false;
boolean Start;
String ZeroS, ZeroM, ZeroG;
public void init() {
resize(0,0);
Start = true;
String ZeroS = new String();
String ZeroM = new String();
String ZeroG = new String();
}
public void start() {
if(killme == null) {
killme = new Thread(this);
killme.start();
}
}
public void stop() {
/* killme = null; */
}
public void run() {
while (killme != null) {
try {
Thread.sleep(500);
}
catch (InterruptedException e) {
}
Date d = new Date();
/********* ty odczytuje czas **********/
Sek = d.getSeconds();
Min = d.getMinutes();
Godz = d.getHours();
if (Sek<10) {
ZeroS = "0";
}
else {
ZeroS="";
};
if (Min<10) {
ZeroM = "0";
}
else {
ZeroM="";
};
if (Godz<10) {
ZeroG = "0";
}
else {
ZeroG="";
};
if ((Poprzed !=Sek) && !Start) {
Poprzed = Sek;
getAppletContext().showStatus(ZeroG + Godz+" : "+ZeroM+Min+" : "+ZeroS+Sek);
}
else {
Start = false;
}
}
killme = null;
}
}
Ponawiam pytanie : dlaczego ???
--
********************************************************************
* *
* Marcin Nowak mno...@asic.ict.pwr.wroc.pl Irc-nick: Chomik *
* http://www.pwr.wroc.pl/~iaeste/marcin.html *
* Technical University of Wroclaw /*
* */
************************ nigdy nie mow nigdy ***********************
************************** never say never *************************
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads