File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clock

 
Jack Bolton
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to do a program with .html and .jsp that has two clocks in it:



1.One classic . And 2. One that would be digital, for example: 3:07. And that the user could edit the hour in the cloks.

what jsp/java classes or other technologies can i use to do this?

thanks for any response...
[ April 16, 2007: Message edited by: Jack Bolton ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you are thinking of an applet, I don't see much in the way of JSP or Java in this. It's much more in the domain of DHTML.

So which way do you want to go? Applet or DHTML?
 
Jack Bolton
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applet
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried searching Google?
It looks like there are quite a few clock applets already out there:
http://www.google.com/search?hl=en&q=clock+applet&btnG=Google+Search\


This one looks pretty cool:
http://www.xanasoft.com/ajclock/
 
Jack Bolton
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using j2sdk1.4.2_11 to run these example:

http://www.raingod.com/raingod/resources/Programming/Java/Software/Clocks/AnalogClock.html

I downloaded the source code in zip:

http://www.raingod.com/raingod/resources/Programming/Java/Software/Clocks/downloads/ClockApplet.zip

and the extended applet:
http://www.raingod.com/raingod/resources/Programming/Java/Software/SharedSource/shared10/ExtendedApplet.java

and i am compiling the ExtendedApplet.java, then i run it, and sends this error:
Exception in thread "main" java.lang.NoSuchMethodError: main

am I doing everithing ok?
what can i do to solve this?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and i am compiling the ExtendedApplet.java, then i run it, and sends this error:
Exception in thread "main" java.lang.NoSuchMethodError: main


How are you running it? Applets are not applications that you can run from the command line - they don't have a "main" method. You need to open an HTML file that contains an applet tag for this particular applet in your web browser.
 
Jack Bolton
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need some help with this program.

I was asked to do two clocks and that the user could edit the hours, as I said in the first post.
But I was told too, that i cannot use applet.


So:
To do such a program that I could not use applet nor dhtml.
How should I do it?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is this an assignment of some sort, designed to make your life harder than necessary?

Well, what technologies can you use then? A standalone Java application? Flash?
 
Jack Bolton
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but if it would be a A standalone Java application.

How would I draw the clock?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm ... the same way you would do it in an applet. Are you familiar with the AWT and/or Swing drawing toolkits?
 
Jack Bolton
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my program:
I put it all here, so you can run it, and see what happens
I converted it to a standalone Java application.
the program runs, and gives the time, but it stays there, it doesn't update.

What can I do so it updates?


Clock2.java


[ April 21, 2007: Message edited by: Jack Bolton ]
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't seem to ever call the start method. In applets, the method is called by the container, but the code you have is not an applet.
 
Jack Bolton
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.
you're a genius!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic