*
The moose likes Swing / AWT / SWT and the fly likes JLabel setText problem... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JLabel setText problem..." Watch "JLabel setText problem..." New topic
Author

JLabel setText problem...

seema prakash
Ranch Hand

Joined: Nov 17, 2004
Posts: 59
Hi,
I have a JInternalFrame with a JDialog that has a JPanel. The panel has a JLabel. The label shows the status of database connection.
But,when executed the label displays only the last text value
ie. Database Connection Successful ....
I tried validate, repaint. But it did not help. Please help.
The relevant code is below :

The listener for the timers t1 andt are as below:
Suman Mummaneni
Ranch Hand

Joined: Dec 14, 2004
Posts: 87
Hi seema,

To me this is last value that is set to lbldbinfo. If that is the label that is displaying the data base status. This is correct.


It might not be displaying the text set in the below code. as it might be connecting to the data base executing the code above. This can be verified by using a System.out.println statement. The possible solution is to use a delay timer before connecting the data base.



Cheers


Suman Mummaneni
Bangalore
India
Jay Aranguren
Greenhorn

Joined: May 08, 2004
Posts: 3
I agree with Suman. I think the problem is something is hogging the system that also shares the same thread as the GUI updates. This results to freezing any updates to occur.

Either you put a delay or better yet put it in a separate thread.

hope this helps.


SCJP<br />SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JLabel setText problem...
 
Similar Threads
connecting to oracle database
Checking input in Dialog box before closing
MY Logo on JDailog
joptionpane problems
Focus problem with setModal in JDialog