Forums Register Login

Calculating time and speed in Java GUI

+Pie Number of slices to send: Send
Ok here is my question. So i'm using Netbeans and have created this template for the program i want to create. Basically what I want to do is enter a time and date in 24hr format including seconds and the date of start and end time and have the program calculate the time difference between Tool launch and tool Receive that takes into factor the Launch and Receive Dates for a total of hh:mm:ss duration. I don't know how to combine both those factors output one number in a total number of hours Duration. I'm also having problems linking the ODO (odometer) which the formula would basically be time/ODO (or distance in feet) = x.x ft/sec format. Any clues or links that i should look into to help? Thanks a bunch.

1
+Pie Number of slices to send: Send
 

Hank Harrison wrote:Ok here is my question. So i'm using Netbeans and have created this template for the program i want to create. Basically what I want to do is enter a time and date in 24hr format including seconds and the date of start and end time and have the program calculate the time difference between Tool launch and tool Receive that takes into factor the Launch and Receive Dates for a total of hh:mm:ss duration. I don't know how to combine both those factors output one number in a total number of hours Duration. I'm also having problems linking the ODO (odometer) which the formula would basically be time/ODO (or distance in feet) = x.x ft/sec format. Any clues or links that i should look into to help? Thanks a bunch.



Stop the GUI coding and develop your program logic using classes that are independent of the way they receive input and provide output. Test those classes with a CLI (Command Line Interface), probably using Scanner and System.out. Once that's done, tying up the model to the GUI will be easy.

If you're using Java 8, there's a new Date/Time API which greatly simplifies the maths involved. (There's even a class named Duration)
keep an eye out for scorpions and black widows. But the tiny ads are safe.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1407 times.
Similar Threads
Combining code Into a GUI interface
Pressing a button to open a new window
java programming
iperf
Socket Connection within same class
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:55:21.