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
  • 168,117
  • 40
  • 217
  • 433
Christian 'fuzi' Orgler
  • 1,682
  • 8
  • 27
  • 51

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,525
  • 20
  • 134
  • 319
  • +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