| | |
Java Time
![]() |
•
•
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 |
add android api applet application applications array arrays automation bank binary bluetooth chat class clear client code codesnippet collections component converter database development dice digit eclipse equation error event formatingtextintooltipjava fractal functiontesting game givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jni jpanel julia linux list loop looping main map method methods mobile myregfun mysql netbeans newbie nonstatic openjavafx parameter pearl php print problem program programming project recursion repositories scanner scrollbar server set size sms sort sorting spamblocker sql sqlserver state storm string superclass swing swt text-file thread threads tree windows





