| | |
Java Time
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2007
Posts: 58
Reputation:
Solved Threads: 0
Hello everyone. I wanted to know how I could create a simple time restriction variable. For example making private double hour; not go over 2:59. Basically I don't want someone to be able to input a number greater than :59 in a Jtextfield. I can do a time application, but that takes a while. I just want to find a simple way of doing it. Thanks in advance. This is what the program is suppose to do below. I've already done everything except getting the time to have a restriction.
A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24 hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write an applet that calculates and displays the parking charges for each customer who parked in the garage yesterday. You chould enter in a JTextField the hours parked for each customer. The applet should display the charge for the current customer and should calculate and display the running total of yesterday's receipts. The applet shoud use the method calculateCharges to determine the charge for each customer.
A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24 hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write an applet that calculates and displays the parking charges for each customer who parked in the garage yesterday. You chould enter in a JTextField the hours parked for each customer. The applet should display the charge for the current customer and should calculate and display the running total of yesterday's receipts. The applet shoud use the method calculateCharges to determine the charge for each customer.
Try Googling "validating JTextField."
First result was your question covered in depth: http://java.sun.com/developer/JDCTec...01/tt1120.html
First result was your question covered in depth: http://java.sun.com/developer/JDCTec...01/tt1120.html
Last edited by destin; Nov 6th, 2008 at 12:28 am.
![]() |
Similar Threads
- Starting "Java" [Java tutorials / resources / faq] (Java)
- FT Junior Java Developer Needed for Major Media firm in NYC (Software Development Job Offers)
- Seek Java Programmer, preferably in FL (Software Development Job Offers)
- SUN java Exam.....Need help (Java)
- hi im new to java project (Java)
- Can I make a Java Image Editing Photshop-like program (Java)
- More C++ developers than Java? (IT Professionals' Lounge)
- Java 3D (Java)
Other Threads in the Java Forum
- Previous Thread: Store the speech content
- Next Thread: signed Applet
| Thread Tools | Search this Thread |
actuate android api applet application applications array arrays automation balls bank binary bluetooth business c++ chat class classes clear client code codesnippet collections component coordinates database defaultmethod development dice doctype dragging ebook eclipse error exception formatingtextintooltipjava fractal froglogic game givemetehcodez graphics gui hql html ide image infinite input integer intersect invokingapacheantprogrammatically j2me java javaprojects jni jpanel julia linux list loop looping map method methods mobile mysql netbeans newbie openjavafx parameter php print problem program programming project recursion repositories scanner screen scrollbar server set size sms sort sorting sql sqlserver state storm string sun superclass swing swt text-file threads tree windows





