Menu

[Solved]Write Application Allows User Select Country List Box Contains Following Seven Options Use Q37174259

Write an applicationthat allows a user to select a country from a list box thatcontains the following seven options. After the user makes aselection, display the country’s capital city.

CountryCapitalAustriaViennaCanadaTorontoEnglandLondonFranceParisItalyRomeMexico

Mexico City

SpainMadrid

***MUST KEEP GIVEN CODE INTACT***

JCapitals.javaimport javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class JCapitals extends JFrame implements ItemListener{
FlowLayout flow = new FlowLayout();
JLabel countryLabel = new JLabel(“Select a country”);
JComboBox<String> countryBox = newJComboBox<String>();
JTextField capitalField = new JTextField(25);
// your code here
public JCapitals() {
// Write your code here
}
public static void main(String[] arguments) {
JCapitals cframe = new JCapitals();
cframe.setSize(400, 150);
cframe.setVisible(true);
}
@Override
public void itemStateChanged(ItemEvent list) {
// Write your code here
}
}

Expert Answer


Answer to Write an application that allows a user to select a country from a list box that contains the following seven options. A… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *