This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes SWT/Swing JLabel repaint issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SWT/Swing JLabel repaint issue" Watch "SWT/Swing JLabel repaint issue" New topic
Author

SWT/Swing JLabel repaint issue

Kelly Dolan
Ranch Hand

Joined: Jan 08, 2002
Posts: 109
I am porting a Swing/AWT application to RCP/SWT. I created the top-level portion of my UI to use RCP/SWT. I have the view which parents an embedded Composite which parents a TabFolder containing TabItems. As a first step, one of my TabItems parents an AWT Frame (e.g., SWT_AWT.new_Frame(this)) which then parents the crux of my original Swing/AWT UI.

In this part of the UI I have a JPanel parenting a variety of centered JLabels. I also have an application thread that runs in the background and updates the text in these labels (e.g., status). In the Swing/AWT application, as the text changes (and gets longer and shorter), I see these changes and the length of the JLabel expands or collapses as necessary. In the RCP/SWT application, while I see the text changing, the length of the JLabel does not change. As a result, the new text is truncated (in the case it requires more space than there currently is) or not centered (in the case it does not require as much space than there current is).

I have tried calling revalidate(), validate() and repaint() on the JLabel and parenting JPanel.

Any help is appreciated!
Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SWT/Swing JLabel repaint issue
 
Similar Threads
FRC Cons?
Sending Keystroke Events to Embedded Swing Components
Graph Library
How can I catch the CTRL_C or CTRL_V event
SWT Resources?