2

I want to have a JButton (for removing the item) in a JList. Button when I add the JButton to my JList, the handler doesn't work... I know it's only rendered,.. but how I can I make it - that I recognize the actionPerformed? Maybe, someone have a code-snippet?

I add a vector-list of JPanels, and inside of these JPanels there are my JButton and JLabel.

Andrew Thompson
  • 166,747
  • 40
  • 210
  • 420
Christian 'fuzi' Orgler
  • 1,624
  • 8
  • 27
  • 50

1 Answers1

3

I think JTable would be better JComponents as JList, because there you can implements TableCellEditor, maybe example with similair output here

Community
  • 1
  • 1
mKorbel
  • 109,107
  • 18
  • 130
  • 305
  • +1 for the table suggestion. Check out the [Table Button Column](http://tips4java.wordpress.com/2009/07/12/table-button-column/) for code to display the button and do the delete. – camickr Jul 26 '11 at 03:26