hi!
i'm trying to write a cellrenderer for a JList, which can show different cell heights.
i.e. in unselected mode, i only want to show a name of a person; in selected mode, i want do show the name of the person AND some other details in the same cell (like the "add and remove programs"-dialog of Windows XP when you select a program to uninstall (it shows then some information about usage etc.))
if(!isSelected) {
/* Not selected */
setPreferredSize(new Dimension(0,25));
setBackground(Color.BLUE);
} else {
/* Selected: */
setPreferredSize(new Dimension(0,45));
setBackground(Color.RED);
}
i tried this code in the getListCellRendererComponent(...)-method, but the JList only uses the first size (25) ... i tried to set the JList-propertie fixedCellHeight to -1, but no changes....
does anybody know how i can solve my problem?
thx a lot & greetz
swissManu