Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Rhalliwell1

macrumors 6502a
Original poster
May 22, 2008
588
1
Hi,

I am trying to write a simple app whereby on the left you have a JList, when you click on an item of the list the details are shown in a JTextArea on the right. I have implemented the JList and the JTextArea but having problems getting the two to speak to each other. Anybody got any suggestions. I am trying to avoid having to click a JButton to update the JTextArea.

(This app will mimic apple's Address Book.app (sort of))

many thanks
 
The simplest way would probably be to just add a ListSelectionListener to the JList and perform the update to the JTextArea (or whatever other elements you want) in the valueChanged method.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.