When I press the button, the text field doesn't update and every time it shows 20000.
The task is to choose from a combo box and then the text field will show you a number.
if STUDIO , Pb. show 10000
if F3 , pb shows 20000
String typoo = typo.getSelectedItem().toString();
int pbb = 0 ;
if (typoo == "Studio") {
pbb = 10000;
}
else if (typoo == "F3") {
pbb = 20000;
}
JButton btnNewButton = new JButton("UPDATE");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
pb.setText(String.valueOf(pbb));
}
});