This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes tabFolder, table and SWT.EraseItem 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 "tabFolder, table and SWT.EraseItem problem" Watch "tabFolder, table and SWT.EraseItem problem" New topic
Author

tabFolder, table and SWT.EraseItem problem

Jonathan Smiths
Greenhorn

Joined: Jan 29, 2010
Posts: 15
I am using SWT to create a GUI for my program.
I have a shell with a tabFolder with two tabItems.
Each of the tabItems controls a different table, so I have two tables in total.
Every 5 minutes I update the contents of both of the tables.
I searched for a way to customize the color of a selected item in a table, and I found information regarding SWT.EraseItem to make this possible.
I used this snippet:


Here is my problem:
When I have selected table2 (tabItem2), and my tables are updated, the first table, table1 gets focus, you can only see table1, though the selected tabItem appears to be tabItem2.
I hope my problem is clear to you, so when updating the tables, the eraseItem listener causes the first table to appear even if the second table is selected.
Bill Coider
Greenhorn

Joined: May 14, 2010
Posts: 4
Have you found a solution to this issue?
I have just come across the exact same problem and I am not sure how to fix.

Bill Coider
Greenhorn

Joined: May 14, 2010
Posts: 4
if you have not found one yet, a workable solution i found is to create the tables inside 'dummy' composites, and then add the composites to the tab folder.
it seems to work ok that way.
does that work for you?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Bill,
Welcome to the Ranch.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
Don't get me started about those stupid light bulbs.
 
subject: tabFolder, table and SWT.EraseItem problem
 
Similar Threads
ListSelectionEvent problems
oracle sql - case statement and count
SWT tableitem, image not displaying properly.
TabFolder / TabItem Code Organsiation
SWT -> TabItem -> addListener