Reputation: 1551
I'm looking for a Swing component that displays several separate strings (probably from a string array or list) on separate lines within a pane or field (scrollable if there's too many to show at once). The user needs to be able to select one of these lines (double-clicking would be ideal) and thereby trigger a listener that does some magic with that line's string. Can anyone point me in the right direction?
Upvotes: 0
Views: 475
Reputation: 324118
The user needs to be able to select one of these lines (double-clicking would be ideal) and thereby trigger a listener that does some magic with that line's string
You can use the List Action for this.
Upvotes: 1
Reputation: 1833
Try a JList: http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JList.html. Can be added to a ScrollPane if you want to include scrolling ability.
Upvotes: 3