"If user input YES for flag1, then the message History is recommended... will display in the first line of JLabel.If user input NO for flag1, then it will not display anything in the first line. My question is how to enable the flag2 message,English core is recommended... to be displayed in the first line of JLabel if the user input NO for flag1 and YES for flag2 "
if (flag1 == 1) {
JLabel label1 = new JLabel("History is recommended because you have not taken the core subject");
label1.setBounds(10, 10, 800, 25);
add(label1);
}
if (flag2 == 2) {
JLabel label2 = new JLabel("English core is recommended because you have not taken the language core");
label2.setBounds(10, 30, 800, 25);
add(label2);