logo

Flight Reservation Form

2 Pages562 Words357 Views
   

Added on  2019-09-16

About This Document

This is a flight reservation form created using Java Swing. It allows users to search for flights and view itineraries. It also includes a color picker using a JSlider.

Flight Reservation Form

   Added on 2019-09-16

ShareRelated Documents
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("");
Flight Reservation Form_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Creating a Flight Reservation GUI with Search and View Functionality
|1
|716
|228

Object-oriented Software Development
|9
|1222
|17

ITECH7410 Software Engineering Methodologies
|12
|980
|92