File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes Help me out in Thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Help me out in Thread" Watch "Help me out in Thread" New topic

Help me out in Thread

Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

I have a swing application. I make a utility which shows output on outputwindow but when i want to print it on jLabel then it doesnot show anything on that label. Here all my process runs in background.

Can anybody help me out how can i show my transaction that is in process to that particular jLabel.

I only know that this could be done in thread but i dont know how? Plz suggest me and send me some code if possible.

Thank you in advance.

Love is GOD and GOD is Love.
Anand Karia
IT Concretor.......
M/s. Anand Karia Concreting IT
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

After you set the JLabel's text, call validate() on the container it's packed into (the JPanel, JFrame, etc that most closely contains it.) This is a necessary step after making any changes to the size of components that are visible on the screen.

[Jess in Action][AskingGoodQuestions]
Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

This is not working.
Madhuri Chanda

Joined: Nov 09, 2005
Posts: 10
May be if you post the part of the code which is setting the JLabel, then someone might know the solution.
Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

Thankx Ernest and Madhuri Chanda

I got the solution by making jLabel static.

Now I can see which number is process and it also fillup grid at the same time.

Thanks one again.
I agree. Here's the link:
subject: Help me out in Thread
It's not a secret anymore!