aspose file tools*
The moose likes Applets and the fly likes Clock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Clock" Watch "Clock" New topic
Author

Clock

Jack Bolton
Ranch Hand

Joined: May 08, 2006
Posts: 65
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

Joined: Jan 10, 2002
Posts: 61435
    
  67

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jack Bolton
Ranch Hand

Joined: May 08, 2006
Posts: 65
Applet
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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/


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jack Bolton
Ranch Hand

Joined: May 08, 2006
Posts: 65
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
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
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.


Ping & DNS - my free Android networking tools app
Jack Bolton
Ranch Hand

Joined: May 08, 2006
Posts: 65
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
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
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

Joined: May 08, 2006
Posts: 65
but if it would be a A standalone Java application.

How would I draw the clock?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
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

Joined: May 08, 2006
Posts: 65
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
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
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

Joined: May 08, 2006
Posts: 65
thanks.
you're a genius!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Clock