Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.EventQueue;
- import javax.swing.ImageIcon;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.JTextArea;
- import javax.swing.JScrollPane;
- import javax.swing.JTextField;
- import javax.swing.SwingConstants;
- import java.awt.Font;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import javax.swing.JLabel;
- import javax.swing.JRadioButton;
- import javax.swing.JComboBox;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JScrollBar;
- import javax.swing.JButton;
- public class regis_hk_f1 {
- private JFrame frame;
- private JTextField text_firstname;
- private JTextField text_lastname;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- regis_hk_f1 window = new regis_hk_f1();
- window.frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public regis_hk_f1() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- frame = new JFrame();
- frame.setBounds(100, 100, 1280, 720);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.getContentPane().setLayout(null);
- JLabel lblFirstname = new JLabel("Firstname ");
- lblFirstname.setFont(new Font("Waffle Light", Font.BOLD, 24));
- lblFirstname.setBounds(55, 145, 74, 16);
- frame.getContentPane().add(lblFirstname);
- text_firstname = new JTextField();
- text_firstname.setBounds(155, 140, 134, 28);
- frame.getContentPane().add(text_firstname);
- text_firstname.setColumns(10);
- JLabel lblLastname = new JLabel("Lastname ");
- lblLastname.setFont(new Font("Waffle Light", Font.BOLD, 24));
- lblLastname.setBounds(316, 145, 90, 16);
- frame.getContentPane().add(lblLastname);
- text_lastname = new JTextField();
- text_lastname.setBounds(428, 140, 134, 28);
- frame.getContentPane().add(text_lastname);
- text_lastname.setColumns(10);
- JRadioButton radio_gender_m = new JRadioButton("male");
- radio_gender_m.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_gender_m.setBounds(155, 200, 80, 23);
- frame.getContentPane().add(radio_gender_m);
- //radio_gender_m.isSelected();
- JRadioButton radio_gender_f = new JRadioButton("female");
- radio_gender_f.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_gender_f.setBounds(247, 200, 80, 23);
- frame.getContentPane().add(radio_gender_f);
- JRadioButton radio_gender_o = new JRadioButton("other");
- radio_gender_o.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_gender_o.setBounds(339, 200, 80, 23);
- frame.getContentPane().add(radio_gender_o);
- JLabel lblGender = new JLabel("Gender ");
- lblGender.setFont(new Font("Waffle Light", Font.BOLD, 24));
- lblGender.setBounds(55, 204, 61, 16);
- frame.getContentPane().add(lblGender);
- JComboBox combo_days = new JComboBox();
- combo_days.setFont(new Font("Waffle Light", Font.BOLD, 24));
- combo_days.setModel(new DefaultComboBoxModel(new String[] {"days"}));
- for(int i = 1; i <= 31; i++) {
- combo_days.addItem(i);
- }
- combo_days.setBounds(155, 254, 100, 30);
- frame.getContentPane().add(combo_days);
- JComboBox combo_months = new JComboBox();
- combo_months.setFont(new Font("Waffle Light", Font.BOLD, 24));
- combo_months.setModel(new DefaultComboBoxModel(new String[] {"months", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}));
- combo_months.setBounds(267, 254, 100, 30);
- frame.getContentPane().add(combo_months);
- JComboBox combo_years = new JComboBox();
- combo_years.setFont(new Font("Waffle Light", Font.BOLD, 24));
- combo_years.setModel(new DefaultComboBoxModel(new String[]{"years"}));
- for(int i = 2014; i>=1890; i--){
- combo_years.addItem(i);
- }
- combo_years.setBounds(379, 254, 100, 30);
- frame.getContentPane().add(combo_years);
- JLabel label_birthday = new JLabel("Birthday");
- label_birthday.setFont(new Font("Waffle Light", Font.BOLD, 24));
- label_birthday.setBounds(55, 253, 61, 28);
- frame.getContentPane().add(label_birthday);
- JLabel label_travelclass = new JLabel("Travel Class");
- label_travelclass.setFont(new Font("Waffle Light", Font.BOLD, 24));
- label_travelclass.setBounds(55, 318, 90, 16);
- frame.getContentPane().add(label_travelclass);
- JRadioButton radio_travel_first = new JRadioButton("Firstclass");
- radio_travel_first.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_travel_first.setBounds(155, 314, 100, 23);
- frame.getContentPane().add(radio_travel_first);
- JRadioButton radio_travel_busin = new JRadioButton("Business");
- radio_travel_busin.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_travel_busin.setBounds(247, 314, 90, 23);
- frame.getContentPane().add(radio_travel_busin);
- JRadioButton radio_travel_eco = new JRadioButton("Economy");
- radio_travel_eco.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_travel_eco.setBounds(339, 314, 141, 23);
- frame.getContentPane().add(radio_travel_eco);
- //ABOUT PICTURE
- ClassLoader loader1 = this.getClass().getClassLoader();
- ImageIcon img2IFC = new ImageIcon(loader1.getResource("images/2IFC.png"));
- JLabel _2IFC = new JLabel(img2IFC);
- _2IFC.setBounds(55, 371, 110, 110);
- frame.getContentPane().add(_2IFC);
- ClassLoader loader2 = this.getClass().getClassLoader();
- ImageIcon imgCausewayBay = new ImageIcon(loader2.getResource("images/CausewayBay.png"));
- JLabel CausewayBay = new JLabel(imgCausewayBay);
- CausewayBay.setBounds(200, 371, 110, 110);
- frame.getContentPane().add(CausewayBay);
- ClassLoader loader3 = this.getClass().getClassLoader();
- ImageIcon imgLanKwaiFong = new ImageIcon(loader2.getResource("images/LanKwaiFong.png"));
- JLabel LanKwaiFong = new JLabel(imgLanKwaiFong);
- LanKwaiFong.setBounds(345, 371, 110, 110);
- frame.getContentPane().add(LanKwaiFong);
- ClassLoader loader4 = this.getClass().getClassLoader();
- ImageIcon imgManMoTemple = new ImageIcon(loader4.getResource("images/ManMoTemple.png"));
- JLabel ManMoTemple = new JLabel(imgManMoTemple);
- ManMoTemple.setBounds(490, 371, 110, 110);
- frame.getContentPane().add(ManMoTemple);
- //ABOUT TICK TO SELECT PLACE THAT WANT TO GO
- JRadioButton radio_go_2ifc = new JRadioButton("2IFC");
- radio_go_2ifc.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_go_2ifc.setBounds(75, 493, 80, 23);
- frame.getContentPane().add(radio_go_2ifc);
- JRadioButton radio_go_cause = new JRadioButton("CAUSEWAYBAY");
- radio_go_cause.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_go_cause.setBounds(186, 493, 141, 23);
- frame.getContentPane().add(radio_go_cause);
- JRadioButton radio_go_lank = new JRadioButton("LANKWAIFONG");
- radio_go_lank.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_go_lank.setBounds(338, 493, 141, 23);
- frame.getContentPane().add(radio_go_lank);
- JRadioButton radio_go_manmo = new JRadioButton("MANMOTEMPLE");
- radio_go_manmo.setFont(new Font("Waffle Light", Font.BOLD, 24));
- radio_go_manmo.setBounds(477, 493, 141, 23);
- frame.getContentPane().add(radio_go_manmo);
- //button book and view profile
- JButton button_book = new JButton("Book");
- button_book.setFont(new Font("Waffle Light", Font.BOLD, 24));
- button_book.setBounds(155, 610, 117, 29);
- frame.getContentPane().add(button_book);
- button_book.addMouseListener(new MouseListener(){
- public void mouseReleased(MouseEvent e){
- //action
- }
- public void mouseClicked(MouseEvent e){}
- public void mousePressed(MouseEvent e){}
- public void mouseExited(MouseEvent e){}
- public void mouseEntered(MouseEvent e){}
- });
- JButton button_viewprofile = new JButton("View Profile");
- button_viewprofile.setFont(new Font("Waffle Light", Font.BOLD, 24));
- button_viewprofile.setBounds(345, 610, 117, 29);
- frame.getContentPane().add(button_viewprofile);
- button_viewprofile.addMouseListener(new MouseListener(){
- public void mouseReleased(MouseEvent e){
- //action
- }
- public void mouseClicked(MouseEvent e){}
- public void mousePressed(MouseEvent e){}
- public void mouseExited(MouseEvent e){}
- public void mouseEntered(MouseEvent e){}
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement