I have tried a lot to find help on google but i couldn't find anything related to my problem.I am facing a severe problem.I am using a JComboBox in my java program it showed only when I run the program first time but after that first time it's not showing drop-down arrow.I Haven't used any removeAll(); or any kind of remove(); methods. Any help would be appreciated as I Have seen a lot people are suffering from the same problem.`class GPACalculator{ JFrame frame; JLabel selection; JComboBox sub; Font f1; JTextField nameText; JButton enter;
public GPACalculator() {
frame = new JFrame("GPA Calculator---COMSATS Institute of Information Technology");
frame.setSize(720, 640);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ImageIcon head = new ImageIcon("images/Header.jpg");
JLabel header = new JLabel(head);
header.setSize(720,90);
header.setLocation(0, 0);
ImageIcon log = new ImageIcon("images/Logo.png");
JLabel logo = new JLabel(log);
logo.setSize(300,300);
logo.setLocation(480, 400);
selection = new JLabel("Select Number Of Subjects And Press Enter");
f1 = new Font("Gabriola",Font.BOLD,30);
selection.setFont(f1);
selection.setLocation(10, 150);
selection.setSize(800, 50);
String[] subject = {"1","2","3","4","5"};
sub = new JComboBox<String>(subject);
sub.setBounds(10, 200, 300, 50);
Container c = frame.getContentPane();
c.setLayout(null);
c.setBackground(new Color(176,196,222));
c.add(header,BorderLayout.CENTER);
c.add(logo);
c.add(selection);
c.add(sub);
}
public static void main(String[] args){
new GPACalculator();
}
} `