Johanna
Johanna

Reputation: 27628

How can we make a list editable?

I want to make my JList editable, what should I do?

Upvotes: 1

Views: 9120

Answers (3)

camickr
camickr

Reputation: 324108

List Editor

Upvotes: 3

Erich Kitzmueller
Erich Kitzmueller

Reputation: 36977

Use a 1-column JTable instead.

Upvotes: 4

Alexander Egger
Alexander Egger

Reputation: 5300

You can find the source code for an editable list here:

http://www.java2s.com/Code/Java/Swing-Components/EditableListExample.htm

Depending on your use case an JComboBox, which is editable, might be a better solution than a JList.

Upvotes: 1

Related Questions