Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TreeItem setBackGround() not working....(Default color of TreeItem not changing)
TreeItem setBackGround() not working.... [message #526680] Mon, 12 April 2010 15:11
Prasad  is currently offline Prasad Friend
Messages: 8
Registered: April 2010
Junior Member
SWT-- TreeViewr-- TreeItem
In the following code i am trying to change the background color of the TreeItem dynamically on selection of the TreeItem, but its not changing the default color.. still its showing the default blue color....

Please help me on this......

private TreeViewer tableTreeViewerSource;
//adding the listener to the treeviewer
tableTreeViewerSource.addSelectionChangedListener(new ISelectionChangedListener(){
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection)event.getSelection();
Object obj = selection.getFirstElement();
TreeItem sourceItem = ComparatorUIUtils.getMatchedTreeItem(((Componenet)obj).getRe fNumber(), tableTreeViewerSource.getTree().getItems(),null);
//i got the treeitem
//trying to change the color
sourceItem.setBackground(sourceItem.getDisplay().getSystemCo lor(SWT.COLOR_DARK_GREEN));


I want to change the color of the Green

Please help me on this..

Previous Topic:[Cocoa] RuntimeException in SWT listener hangs everything
Next Topic:Maven Repository for SWT?
Goto Forum:

Current Time: Sat Dec 14 06:12:33 GMT 2019

Powered by FUDForum. Page generated in 0.01897 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top