Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use timer?  RSS feed

 
Jack Rudolf
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, could you help me with my work.
I have a tabbed pane which contain 3 JTextArea and one JList that shows the movie names inside. they are called gArea1 gArea2 and gArea3a and listg. I put title of movies in the gArea1. When i select the movie, it changes the movie name in gArea1 and changes the estimated finish time in gArea3 basing on the length of the movie in duration array!


listg.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
JList listgl = (JList)e.getSource();
int index = listgl.getSelectedIndex();
garea2.setText(FileAccess.titleDVD[index]);
....(this part is to get the time now and the estimated time finish)

Now, what i need to do is to put date and time that updates like the normal clock does inside the second JTextArea in the format of DD-MMM-YY HH:MM:SS

SEcond...i have array of time
static final int[] duration = {90,100,120,99,98,76,73,89,110,135,165,};
and all of those are in minutes. So, the the second JTextArea is about synchronising the time after the time now.. let say... now time is 15:02:01 in gArea1 and as the index[0] goes in, the time is 16.32:01 in gArea2. and so on...Could you please help me with this.... Thank you..i would appreciate it so much if you could help me with codes!

[ September 05, 2004: Message edited by: Rudi ]
[ September 05, 2004: Message edited by: Rudi ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rudi,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

We request that displays follow the pattern FIRST_NAME + SPACE + LAST_NAME.

Thanks Pardner! Hope to see you 'round the Ranch!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's something to play around with

 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!