Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JButton btn = new JButton("OK");
- btn.addActionListener(
- new ActionListener(){
- public void actionPerformed(ActionEvent e){
- String currentCountry = (String)cb.getSelectedItem();
- double percentage = 0.00;
- if(currentCountry.equals("Brazil") || currentCountry.equals("Argentina")) {
- cb2.removeAllItems();
- for(int i = 0; i < choicesSouthAmerica.length; i++) {
- cb2.addItem(choicesSouthAmerica[i]);
- }
- }
- else {
- cb2.removeAllItems();
- for(int i = 0; i < choicesEurope.length; i++) {
- cb2.addItem(choicesEurope[i]);
- }
- }
- btn.setEnabled(false);
- btn2.setEnabled(true);
- if(currentCountry.equals("Brazil") || currentCountry.equals("Argentina")){
- percentage = 1/5;
- }
- else{
- percentage = 1/8;
- }
- }
- }
- );
Add Comment
Please, Sign In to add comment