How to know which jList is selected
Each JList can have a selected item in it. What do you mean by "JList is selected"? They all can have a selected item. Have you looked at the API doc for the JList class? It has lots of methods that could help you. The method you are using would tell you if a JList has nothing selected.
One problem I see in your code is that you are using an assignment operator = instead of an equality test operator == in the if statements.
Why are you using negative logic: notSelected instead of positive: isSelected?
You are asking: is this JList not not selected instead of is it selected
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Give id a default value when you define it.
The if/else if chain will stop testing ater the first true is found. What if more than one list has a selecton?
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Question Answered as of 1 Year Ago by
NormR1
and
mehfooz