Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.FlowLayout;
- import java.awt.GridLayout;
- import javax.swing.BorderFactory;
- import javax.swing.JApplet;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JComboBox;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JTextField;
- public class AvionskiBilet extends JApplet{
- String[] destinacii = {"Ilinden", "Nedojdija", "Paris", "Barcelona"};
- JPanel options = new JPanel(new GridLayout(2, 2, 0, 10));
- JPanel options_top = new JPanel(new GridLayout(2, 2));
- JPanel options_bottom = new JPanel(new GridLayout(1, 2, 0, 0));
- JPanel options_bottom_left = new JPanel(new GridLayout(2, 1, 0, 10));
- JPanel options_bottom_right = new JPanel(new GridLayout(3, 1, 0, 5));
- JPanel info = new JPanel(new GridLayout(3, 2));
- JPanel payment = new JPanel(new GridLayout(1, 4));
- JPanel butt = new JPanel (new GridLayout(1, 2));
- JButton buy = new JButton("Buy");
- JButton cancel = new JButton("Cancel");
- JLabel empty = new JLabel();
- JComboBox dest_from = new JComboBox(destinacii);
- JComboBox dest_to = new JComboBox(destinacii);
- JLabel title_dest_from = new JLabel("Destination (from):");
- JLabel title_dest_to = new JLabel("Destination (to):");
- JLabel no_seats = new JLabel("Number of seats:");
- JLabel lug = new JLabel("Type of luggage:");
- JTextField tekst = new JTextField(1);
- JCheckBox bag = new JCheckBox("Bag");
- JCheckBox suitcase = new JCheckBox("Suitcase");
- @Override
- public void init() {
- setLayout(new GridLayout(4, 1));
- options.setBorder(BorderFactory.createTitledBorder("Flight options:"));
- info.setBorder(BorderFactory.createTitledBorder("Personal info:"));
- payment.setBorder(BorderFactory.createTitledBorder("Payment:"));
- butt.add(empty);
- butt.add(buy);
- butt.add(cancel);
- options.add(options_top);
- options_top.add(title_dest_from);
- options_top.add(title_dest_to);
- options_top.add(dest_from);
- options_top.add(dest_to);
- options.add(options_bottom);
- options_bottom.add(options_bottom_left);
- options_bottom_left.add(no_seats);
- options_bottom_left.add(lug);
- options_bottom.add(options_bottom_right);
- options_bottom_right.add(tekst);
- options_bottom_right.add(bag);
- options_bottom_right.add(suitcase);
- this.getContentPane().add(options);
- this.getContentPane().add(info);
- this.getContentPane().add(payment);
- this.getContentPane().add(butt);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement