• Post Reply Bookmark Topic Watch Topic
  • New Topic

jbutton action performed

 
Carl John
Ranch Hand
Posts: 47
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i'm developing a swing application.In that application i have to calculate the time taken for performing an Action event for JButton..

i want to display the time(in seconds..) for the user to wait for that extend in performing that action...

please guide me...


Thanks in advance...!
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the possible ways to do this would be to use the System#currentTimeMillis();

In pseudo code
1) Invoke currentTimeMillis() and retain the value as start time
2) Do stuff
3) Invoke currentTimeMillis() and retain the value as end time.

Difference between end and start time would give you the time required to do stuff.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> i want to display the time(in seconds..) for the user to wait for that extend in performing that action...

have a look at ProgressMonitor
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!