• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Clock

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Applet
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but if it would be a A standalone Java application.

How would I draw the clock?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks.
you're a genius!
 
A "dutch baby" is not a baby. But this tiny ad is baby sized:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic