Dear ULC-List,

 

I'm trying to convince an ULCTabletree to draw the column content in a
centered way. Hence, I have

written a render component. Unfortunately the setting is completely
ignored. For testing purposes

I have set the text to a standard value and the background color to red.
The text is ignored as well, while

the red background color is displayed.

 

In the archive I found the following article, which made me believe the
code snippet below

should work.. Could someone please tell me what I am doing wrong?

 

http://lists.canoo.com/mailman/private/ulc-developer/2003/000495.html

 

Kind regards

 

Kevin Hirschmann

 

 

 

 

package awino.gui.renderer;

 

import com.ulcjava.base.application.IRendererComponent;

import com.ulcjava.base.application.ULCLabel;

import com.ulcjava.base.application.ULCTableTree;

import com.ulcjava.base.application.tabletree.ITableTreeCellRenderer;

import com.ulcjava.base.application.util.Color;

 

public class HistoryRenderer extends ULCLabel implements
ITableTreeCellRenderer{

 

 

 

      public IRendererComponent
getTableTreeCellRendererComponent(ULCTableTree tableTree, Object value,

                  boolean selected, boolean hasFocus, boolean expanded,
boolean leaf, Object

                  node) {                 

            setOpaque(true);

            setBackground(Color.red);

            setHorizontalTextPosition(ULCLabel.CENTER);          

            setText("test");

            return this;

      }

 

}

 

 

And somewhere in my code I am setting:

 

tabtrHistorie.getColumnModel().getColumn(1).setCellRenderer(tabletreeRen
derer);

 

Reply via email to