J
John Broadley
Hello,
I am building two separate classes. The first class extends the
JPanel, creates a JList and implements a ListSelectionListener.
The second class extends the JPanel, and creates a JTextField in it.
I create instances of both classes, and put them in a JFrame.
When the user selects an item from the JList in the first JPanel, my
listener code is called. In this case, I would like to send the
selected item text to the second JPanel to pass it to its JTextField.
I first started with having the JList and JTextField created in the
JFrame, and from the ListSelectionListener code, I was seeing the
JTextField, and communication was possible. After a while, I felt that
I need more functionalities, so I though of separating the JList, and
JTextField in two separate stand alone classes capable of handling
several types of requests, but then I was not able to have
communication between the two anymore.
Appreciate your help.
Thank you.
I am building two separate classes. The first class extends the
JPanel, creates a JList and implements a ListSelectionListener.
The second class extends the JPanel, and creates a JTextField in it.
I create instances of both classes, and put them in a JFrame.
When the user selects an item from the JList in the first JPanel, my
listener code is called. In this case, I would like to send the
selected item text to the second JPanel to pass it to its JTextField.
I first started with having the JList and JTextField created in the
JFrame, and from the ListSelectionListener code, I was seeing the
JTextField, and communication was possible. After a while, I felt that
I need more functionalities, so I though of separating the JList, and
JTextField in two separate stand alone classes capable of handling
several types of requests, but then I was not able to have
communication between the two anymore.
Appreciate your help.
Thank you.