This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why the JLabel is not updated immediately?  RSS feed

 
Swerrgy Smith
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am a beginner in Swing programming. I have a JFrame with a button and a label below:




I expect that the countLabel is updated after every second.
However, when I click the start button, the countLabel is not updated after every second. It is only updated at the 5th second with the value 4.
Can anyone explain this for me?



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!