Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help me out in Thread

 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not working.
 
Madhuri Chanda
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic