I need your suggestions and recommendations for the next assignment.
I have a frame that has two JComboBoxes, which are supposedly called combo1 and combo2, JTable and other components.
At the initial stage, when the frame is visible with the above component. The combo1 combination is filled with some values, but at the initial stage no value is selected, combobo combobox is disabled and the table is empty.
I added actionListener to combo1 as well as combo2. There are two types of values ββin combo1: suppose these values ββare type1 and type2.
Condition 1: When we select the type1 value from Combo1, the actionListener method is called combo1, which calls the method that combo2 remains disabled, and adds some rows to the table associated with the selected type1 value from combo1.
Condition 2: when we select the type2 value from combo1, the actionListener method is called combo1, which calls the method that causes combo2 to fill in with some values ββof type 2 and is turned on, but the value is not selected from combo2, and the table should also remain empty until we will not select any value from combo2.
each time a value is added to combo2, the combo2 action listener method is launched. In the actionListener method is combo2, which receives the value combo2, but there is no combo2 value selected, which throws a NullPointerException.
So, what should I do so that the combo2 member list method does not execute after adding values ββto combo2.