 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
llloyd wood Guest
|
Posted: Tue Apr 03, 2007 12:31 am Post subject: pls fix with instructional comments |
|
|
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.Calendar;
public class MyClock {
Calendar now = Calendar.getInstance();
int h = now.get(Calendar.HOUR_OF_DAY);
int m = now.get(Calendar.MINUTE);
int s = now.get(Calendar.SECOND);
private JTextField _timeField;
public void showClock(){
_timeField = new JTextField(5); // create display
_timeField.setEditable(false);
_timeField.setFont(new Font("sansserif", Font.PLAIN, 4 );
JPanel content = new JPanel(); // put time in display
content.setLayout(new FlowLayout());
content.add(_timeField);
}
/**
* @param args
*/
public static void main(String[] args) {
showClock()
// all in main, not cool
}
}
b
--
Sometimes I'm in a good mood.
Sometimes I'm in a bad mood.
When all my moods have cum to pass
i hope they bury me upside down
so the world can kiss me porcelain,
white, Irish bottom. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|