editing hour

I am working with an applet that display two clocks that shows the hour.Using classes as:SimpleDateFormatDatehow can i program it , so the user could edit the hour in the clocks?and that when the applet starts, that it shows random hours?
[280 byte] By [deroka] at [2007-11-27 1:40:05]
# 1
Random: http://java.sun.com/javase/6/docs/api/java/util/Random.html
DrLaszloJamfa at 2007-7-12 0:53:53 > top of Java-index,Java Essentials,Java Programming...
# 2

I have declared like this:

in my init method:

randomVariable= new Random();

lastdate = formatter.format(currentDate);

lastdate is a String that holds the date.

formatter formats the date

How i should interact/declare with the Random variable?

deroka at 2007-7-12 0:53:53 > top of Java-index,Java Essentials,Java Programming...
# 3
How is currentDate initialized?
DrLaszloJamfa at 2007-7-12 0:53:53 > top of Java-index,Java Essentials,Java Programming...
# 4
in init:currentDate = new Date();
deroka at 2007-7-12 0:53:53 > top of Java-index,Java Essentials,Java Programming...
# 5
Is that a random date? Hmm....
DrLaszloJamfa at 2007-7-12 0:53:53 > top of Java-index,Java Essentials,Java Programming...
# 6
no it gives the date and time of my pc.the way the formatter is declared:formatter = new SimpleDateFormat ("EEE MMM dd hh:mm:ss yyyy", Locale.getDefault());Message was edited by: derok
deroka at 2007-7-12 0:53:53 > top of Java-index,Java Essentials,Java Programming...
# 7
But you want the initial date to be random, right? Hmm...
DrLaszloJamfa at 2007-7-12 0:53:53 > top of Java-index,Java Essentials,Java Programming...
# 8
yeah
deroka at 2007-7-12 0:53:53 > top of Java-index,Java Essentials,Java Programming...
# 9
So how do you combine Random+Date to create a random date? Hint: consider the possible Date constructors that are not deprecated.
DrLaszloJamfa at 2007-7-12 0:53:54 > top of Java-index,Java Essentials,Java Programming...
# 10
i'm kinda lost here :)is there other aproach to do this?
deroka at 2007-7-12 0:53:54 > top of Java-index,Java Essentials,Java Programming...
# 11
It's not hard. You want a random date. Hard to think of doing that in a simpler fashion that Random + Date.
DrLaszloJamfa at 2007-7-12 0:53:54 > top of Java-index,Java Essentials,Java Programming...
# 12
> It's not hard. You want a random date. Hard to think> of doing that in a simpler fashion that Random + Date.I know this is the way to do it.But I am having problem declaring the variables/objects and with the syntax.how do I solve this?
deroka at 2007-7-12 0:53:54 > top of Java-index,Java Essentials,Java Programming...
# 13
Post your code with the syntax error and a forum member may give you a hint.
DrLaszloJamfa at 2007-7-12 0:53:54 > top of Java-index,Java Essentials,Java Programming...
# 14
..
deroka at 2007-7-12 0:53:54 > top of Java-index,Java Essentials,Java Programming...
# 15
That is a problem :-(
DrLaszloJamfa at 2007-7-21 20:11:49 > top of Java-index,Java Essentials,Java Programming...
# 16
> > Post your code with the syntax error and a forum> > member may give you a hint.> ..I almost fell off my chair laughing!
CaptainMorgan08a at 2007-7-21 20:11:49 > top of Java-index,Java Essentials,Java Programming...