Hi all,

I've coded my own MyCellRenderer as an inner class which implements
ListCellRenderer interface. I'm using this to display a JList.   (ie.
MyJList.setCellRenderer(MyCellRenderer) );

My "public Component getListCellRendererComponent(JList list, Object value, int
index, boolean isSelected, boolean cellHasFocus)" method returns a JPanel which
uses a GridLayout(4,1) to display a set of Components for each row of the JList
- the components within the JPanel are two JLabels, aJComboBox and a JButton.

The code runs fine, and I get a JList rendered exactly how I want.

However - none of the Components in the JList are usable by the user.  8(

The JComboBoxes won't expand to show the possible selections and the JButtons
won't depress and release when I click them with the mouse. (I've added an
anonymous actionPerformed(ActionEvent e) to each JButton which simply prints
"Hello" when any button is pressed, but I interacting with the buttons doesn't
generate that message).

Have I misunderstood something about ListCellRenderer ? It seems that you can
only set the way the JList is shown to the user, but can't interact with any of
the components returned by the getListCellRendererComponent method?

thanks in advance for any help,

     andy




**********************************************************************
This e-mail has been sent from a PC belonging to DSG Retail Limited or another company 
in the Dixons Group, registered office Maylands Avenue, Hemel Hempstead, Hertfordshire 
HP2 7TG.  Its contents are confidential to the sender and the intended recipient.

If you receive it in error, please tell us by return and then delete it from your 
system;  you may not rely on its contents nor copy/disclose it to anyone.

Opinions, conclusions and statements of intent in this e-mail are those of the sender 
and will not bind a Dixons Group company unless confirmed by an authorised 
representative independently of this message.  We do not accept responsibility for 
viruses;  you must scan for these.

Please note that e-mails sent to and from the Dixons Group are routinely monitored for 
record keeping, quality control and training purposes, to ensure regulatory compliance 
and to prevent viruses and unauthorised use of our computer systems.

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to