I want a JTextField
to appear when user select "Extra" in JComboBox
list and hidden otherwise. But the JTextField is not appearing when user is selecting "Extra" but it is appearing if i shrink the window and enlarge it again. After doing like that it is working properly, only for the first time it is not appearing. Why it is behaving like that? any solution for this?
Here is my code:
getCmbJtocsv_C_8().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
{
input3 = (String)adaptor.getCmbJtocsv_C_8().getSelectedItem();
adaptor.getTxtJtocsv_C_8().setVisible(false);
if(input3.equals("extra")){
adaptor.getTxtJtocsv_C_8().setVisible(true);
}
}
i have changed the string comparison and i'm still getting the same result.