pls fix with instructional comments
- From: llloyd wood <comprehensivecenter>
- Date: Mon, 02 Apr 2007 15:31:35 -0400
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, 48));
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.
.
- Prev by Date: Re: C++ vs Java "new" (no flame war please!)
- Next by Date: Re: C++ vs Java "new" (no flame war please!)
- Previous by thread: looking for some hands on experience
- Next by thread: this is wha i'm working on: any help???
- Index(es):
Relevant Pages
|