Skip to main content



      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 11:11
Eclipse UserFriend
Hi,
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 treeitem..as Green

Please help me on this..


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


Current Time: Fri Aug 29 18:08:39 EDT 2025

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

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

Back to the top