import javax.swing.JFrame; import javax.swing.JLabel; import

Added on - 18 Sep 2019

  • 2

    Pages

  • 562

    Words

  • 93

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 1 of 2 pages
import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JPanel;import javax.swing.JSlider;import javax.swing.JTextField;import javax.swing.JComboBox;import javax.swing.JButton;import javax.swing.JOptionPane;import javax.swing.event.ChangeEvent;import javax.swing.event.ChangeListener;import java.awt.Color;import java.awt.GridLayout;import java.awt.event.ActionEvent;public class AirportFrame extends JFrame {public static void main(String[] args) {new AirportFrame().run();}public void run() {JPanel panel = new JPanel();panel.setLayout(new GridLayout(0, 1));JLabel labelAirline = new JLabel("Airline: ", JLabel.LEFT);panel.add(labelAirline);JLabel labelSourceAir = new JLabel("Source Airport: ", JLabel.LEFT);panel.add(labelSourceAir);JLabel labelDestAir = new JLabel("Destination Airport: ", JLabel.LEFT);panel.add(labelDestAir);JLabel labelDepTime = new JLabel("Departure Time: ", JLabel.LEFT);panel.add(labelDepTime);JLabel labelArrTime = new JLabel("Arrival Time: ", JLabel.LEFT);panel.add(labelArrTime);JTextField tfAirline = new JTextField("");tfAirline.addActionListener();JOptionPane.showMessageDialog(null, "Airline Unavailable. Please choose another airline.");panel.add(tfAirline);JTextField tfSourceAir = new JTextField("");tfSourceAir.addActionListener();JOptionPane.showMessageDialog(null, "Unknown city.");panel.add(tfSourceAir);JTextField tfDestAir = new JTextField("");tfDestAir.addActionListener();JOptionPane.showMessageDialog(null, "Unknown city.");panel.add(tfDestAir);JTextField tfDepTime = new JTextField("");
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document