• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Timer not working correctly

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cant find the issue why it's not counting up, but showing some random numbers.

 
Marshal
Posts: 8856
637
Mac OS X VI Editor BSD Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please provide relevant part of code which is responsible for particular task you're failing to accomplish.
You should not be expecting: that someone will go and read more than 500 lines of code; will try to understand what this code is doing in general; will copy this code to their own IDE's and will try to debug.

Please provide more details
1. Given inputs if there were some;
2. Expected outputs;
3. Actual outputs;
4. Error messages (copied and pasted exactly as they appear) in case those appear on particular inputs;
5. Other important details which could help someone to give you an insight on what could be wrong;

And let's hope someone will be able to help.

I shall copy this topic to our other relevant forum, so the probability to get an accurate answer would get increased
 
Bartender
Posts: 732
10
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jButton2.setText("jButton2");


Why jButton2 as the text?

In your constructor you have this (indentation fixed):


But you haven't set jButton3 to be selected, so the timer is never started.
 
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another thing: line 440. Why are you setting those fields visible or invisible? That does not look right. There are ways to make components come to the top; this tutorial suggests one solution.
There is also something wrong with the multiple ifs; there must be an elegant way to express what you want. Maybe a List or an array?
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Fred Kleinschmidt wrote:

jButton2.setText("jButton2");


Why jButton2 as the text?



That's the default value used in Netbeans GUI builder.
 
Fred Kleinschmidt
Bartender
Posts: 732
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops - copied the wrong line. I meant line 161 which sets "jButton2" as the text for jButton3.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic