This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Add label to frame during button action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Add label to frame during button action" Watch "Add label to frame during button action" New topic
Author

Add label to frame during button action

Krithika Beri
Ranch Hand

Joined: Sep 11, 2012
Posts: 36
My requirement is that there is a process which is taking place which takes quite some time. The process starts when a button is clicked. So when the button is clicked, I want to add a Label before the actual process starts to show that the process is in progress. But what i found is that, after the button action is completed only then the JFrame is updated with the label. Please help
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10425
    
    8

You are having a threading issue.
Check out https://www.coderanch.com/how-to/java/JProgressBarDoesntUpdate


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4571
    
    5

May be better than a simple JLabel, if you're in a position to take up the extra learning: How to Use Progress Bars


luck, db
There are no new questions, but there may be new answers.
 
GeeCON Prague 2014
 
subject: Add label to frame during button action