Forums Register Login

Timer not working correctly

+Pie Number of slices to send: Send
I cant find the issue why it's not counting up, but showing some random numbers.

1
+Pie Number of slices to send: Send
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
1
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
 

Fred Kleinschmidt wrote:

jButton2.setText("jButton2");


Why jButton2 as the text?



That's the default value used in Netbeans GUI builder.
+Pie Number of slices to send: Send
Oops - copied the wrong line. I meant line 161 which sets "jButton2" as the text for jButton3.
That's a very big dog. I think I want to go home now and hug this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 752 times.
Similar Threads
Pressing a button to open a new window
iperf
How to add JTable into a JPanel
Socket Connection within same class
Need help populating a JList in NetBeans
More...

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