Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JLabel not showing after setVisible(true)

843805Oct 20 2006 — edited Nov 20 2006
Hi,

I have a JButton with the following added as actionlistener:
                    public void actionPerformed(ActionEvent e) {
                        label.setVisible(true);
                        //here's some timeconsuming applicationcode called.
                        label.setVisible(false);
                    }
The problem is my label is not showing! I then tried to put the call in a "invokelater-method" from SwingUtilities, but here I got an exception telling me that I already was excuting the code on the EventDispatcherThread - and well, yes I can see that :)
But if I do that, why isn't my label showing? I have tried different things to force a redraw of the GUI, but with no success!

What do I do?

Thanks :)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2006
Added on Oct 20 2006
6 comments
303 views