Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.53 KB | None | 0 0
  1. import java.awt.EventQueue;
  2.  
  3. import javax.swing.ImageIcon;
  4. import javax.swing.JFrame;
  5. import javax.swing.JPanel;
  6. import javax.swing.JTextArea;
  7. import javax.swing.JScrollPane;
  8. import javax.swing.JTextField;
  9. import javax.swing.SwingConstants;
  10.  
  11. import java.awt.Font;
  12. import java.awt.event.MouseEvent;
  13. import java.awt.event.MouseListener;
  14.  
  15. import javax.swing.JLabel;
  16. import javax.swing.JRadioButton;
  17. import javax.swing.JComboBox;
  18. import javax.swing.DefaultComboBoxModel;
  19. import javax.swing.JScrollBar;
  20. import javax.swing.JButton;
  21.  
  22.  
  23. public class regis_hk_f1 {
  24.  
  25. private JFrame frame;
  26. private JTextField text_firstname;
  27. private JTextField text_lastname;
  28.  
  29. /**
  30. * Launch the application.
  31. */
  32. public static void main(String[] args) {
  33. EventQueue.invokeLater(new Runnable() {
  34. public void run() {
  35. try {
  36. regis_hk_f1 window = new regis_hk_f1();
  37. window.frame.setVisible(true);
  38. } catch (Exception e) {
  39. e.printStackTrace();
  40. }
  41. }
  42. });
  43. }
  44.  
  45. /**
  46. * Create the application.
  47. */
  48. public regis_hk_f1() {
  49. initialize();
  50. }
  51.  
  52. /**
  53. * Initialize the contents of the frame.
  54. */
  55. private void initialize() {
  56. frame = new JFrame();
  57. frame.setBounds(100, 100, 1280, 720);
  58. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  59. frame.getContentPane().setLayout(null);
  60.  
  61. JLabel lblFirstname = new JLabel("Firstname ");
  62. lblFirstname.setFont(new Font("Waffle Light", Font.BOLD, 24));
  63. lblFirstname.setBounds(55, 145, 74, 16);
  64. frame.getContentPane().add(lblFirstname);
  65.  
  66. text_firstname = new JTextField();
  67. text_firstname.setBounds(155, 140, 134, 28);
  68. frame.getContentPane().add(text_firstname);
  69. text_firstname.setColumns(10);
  70.  
  71. JLabel lblLastname = new JLabel("Lastname ");
  72. lblLastname.setFont(new Font("Waffle Light", Font.BOLD, 24));
  73. lblLastname.setBounds(316, 145, 90, 16);
  74. frame.getContentPane().add(lblLastname);
  75.  
  76. text_lastname = new JTextField();
  77. text_lastname.setBounds(428, 140, 134, 28);
  78. frame.getContentPane().add(text_lastname);
  79. text_lastname.setColumns(10);
  80.  
  81. JRadioButton radio_gender_m = new JRadioButton("male");
  82. radio_gender_m.setFont(new Font("Waffle Light", Font.BOLD, 24));
  83. radio_gender_m.setBounds(155, 200, 80, 23);
  84. frame.getContentPane().add(radio_gender_m);
  85. //radio_gender_m.isSelected();
  86.  
  87.  
  88. JRadioButton radio_gender_f = new JRadioButton("female");
  89. radio_gender_f.setFont(new Font("Waffle Light", Font.BOLD, 24));
  90. radio_gender_f.setBounds(247, 200, 80, 23);
  91. frame.getContentPane().add(radio_gender_f);
  92.  
  93. JRadioButton radio_gender_o = new JRadioButton("other");
  94. radio_gender_o.setFont(new Font("Waffle Light", Font.BOLD, 24));
  95. radio_gender_o.setBounds(339, 200, 80, 23);
  96. frame.getContentPane().add(radio_gender_o);
  97.  
  98. JLabel lblGender = new JLabel("Gender ");
  99. lblGender.setFont(new Font("Waffle Light", Font.BOLD, 24));
  100. lblGender.setBounds(55, 204, 61, 16);
  101. frame.getContentPane().add(lblGender);
  102.  
  103. JComboBox combo_days = new JComboBox();
  104. combo_days.setFont(new Font("Waffle Light", Font.BOLD, 24));
  105. combo_days.setModel(new DefaultComboBoxModel(new String[] {"days"}));
  106. for(int i = 1; i <= 31; i++) {
  107. combo_days.addItem(i);
  108. }
  109. combo_days.setBounds(155, 254, 100, 30);
  110. frame.getContentPane().add(combo_days);
  111.  
  112. JComboBox combo_months = new JComboBox();
  113. combo_months.setFont(new Font("Waffle Light", Font.BOLD, 24));
  114. combo_months.setModel(new DefaultComboBoxModel(new String[] {"months", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}));
  115. combo_months.setBounds(267, 254, 100, 30);
  116. frame.getContentPane().add(combo_months);
  117.  
  118. JComboBox combo_years = new JComboBox();
  119. combo_years.setFont(new Font("Waffle Light", Font.BOLD, 24));
  120. combo_years.setModel(new DefaultComboBoxModel(new String[]{"years"}));
  121. for(int i = 2014; i>=1890; i--){
  122. combo_years.addItem(i);
  123. }
  124. combo_years.setBounds(379, 254, 100, 30);
  125. frame.getContentPane().add(combo_years);
  126.  
  127. JLabel label_birthday = new JLabel("Birthday");
  128. label_birthday.setFont(new Font("Waffle Light", Font.BOLD, 24));
  129. label_birthday.setBounds(55, 253, 61, 28);
  130. frame.getContentPane().add(label_birthday);
  131.  
  132. JLabel label_travelclass = new JLabel("Travel Class");
  133. label_travelclass.setFont(new Font("Waffle Light", Font.BOLD, 24));
  134. label_travelclass.setBounds(55, 318, 90, 16);
  135. frame.getContentPane().add(label_travelclass);
  136.  
  137. JRadioButton radio_travel_first = new JRadioButton("Firstclass");
  138. radio_travel_first.setFont(new Font("Waffle Light", Font.BOLD, 24));
  139. radio_travel_first.setBounds(155, 314, 100, 23);
  140. frame.getContentPane().add(radio_travel_first);
  141.  
  142. JRadioButton radio_travel_busin = new JRadioButton("Business");
  143. radio_travel_busin.setFont(new Font("Waffle Light", Font.BOLD, 24));
  144. radio_travel_busin.setBounds(247, 314, 90, 23);
  145. frame.getContentPane().add(radio_travel_busin);
  146.  
  147. JRadioButton radio_travel_eco = new JRadioButton("Economy");
  148. radio_travel_eco.setFont(new Font("Waffle Light", Font.BOLD, 24));
  149. radio_travel_eco.setBounds(339, 314, 141, 23);
  150. frame.getContentPane().add(radio_travel_eco);
  151.  
  152. //ABOUT PICTURE
  153. ClassLoader loader1 = this.getClass().getClassLoader();
  154. ImageIcon img2IFC = new ImageIcon(loader1.getResource("images/2IFC.png"));
  155. JLabel _2IFC = new JLabel(img2IFC);
  156. _2IFC.setBounds(55, 371, 110, 110);
  157. frame.getContentPane().add(_2IFC);
  158.  
  159. ClassLoader loader2 = this.getClass().getClassLoader();
  160. ImageIcon imgCausewayBay = new ImageIcon(loader2.getResource("images/CausewayBay.png"));
  161. JLabel CausewayBay = new JLabel(imgCausewayBay);
  162. CausewayBay.setBounds(200, 371, 110, 110);
  163. frame.getContentPane().add(CausewayBay);
  164.  
  165. ClassLoader loader3 = this.getClass().getClassLoader();
  166. ImageIcon imgLanKwaiFong = new ImageIcon(loader2.getResource("images/LanKwaiFong.png"));
  167. JLabel LanKwaiFong = new JLabel(imgLanKwaiFong);
  168. LanKwaiFong.setBounds(345, 371, 110, 110);
  169. frame.getContentPane().add(LanKwaiFong);
  170.  
  171. ClassLoader loader4 = this.getClass().getClassLoader();
  172. ImageIcon imgManMoTemple = new ImageIcon(loader4.getResource("images/ManMoTemple.png"));
  173. JLabel ManMoTemple = new JLabel(imgManMoTemple);
  174. ManMoTemple.setBounds(490, 371, 110, 110);
  175. frame.getContentPane().add(ManMoTemple);
  176.  
  177.  
  178. //ABOUT TICK TO SELECT PLACE THAT WANT TO GO
  179.  
  180. JRadioButton radio_go_2ifc = new JRadioButton("2IFC");
  181. radio_go_2ifc.setFont(new Font("Waffle Light", Font.BOLD, 24));
  182. radio_go_2ifc.setBounds(75, 493, 80, 23);
  183. frame.getContentPane().add(radio_go_2ifc);
  184.  
  185. JRadioButton radio_go_cause = new JRadioButton("CAUSEWAYBAY");
  186. radio_go_cause.setFont(new Font("Waffle Light", Font.BOLD, 24));
  187. radio_go_cause.setBounds(186, 493, 141, 23);
  188. frame.getContentPane().add(radio_go_cause);
  189.  
  190. JRadioButton radio_go_lank = new JRadioButton("LANKWAIFONG");
  191. radio_go_lank.setFont(new Font("Waffle Light", Font.BOLD, 24));
  192. radio_go_lank.setBounds(338, 493, 141, 23);
  193. frame.getContentPane().add(radio_go_lank);
  194.  
  195. JRadioButton radio_go_manmo = new JRadioButton("MANMOTEMPLE");
  196. radio_go_manmo.setFont(new Font("Waffle Light", Font.BOLD, 24));
  197. radio_go_manmo.setBounds(477, 493, 141, 23);
  198. frame.getContentPane().add(radio_go_manmo);
  199.  
  200.  
  201. //button book and view profile
  202.  
  203. JButton button_book = new JButton("Book");
  204. button_book.setFont(new Font("Waffle Light", Font.BOLD, 24));
  205. button_book.setBounds(155, 610, 117, 29);
  206. frame.getContentPane().add(button_book);
  207.  
  208. button_book.addMouseListener(new MouseListener(){
  209. public void mouseReleased(MouseEvent e){
  210. //action
  211. }
  212. public void mouseClicked(MouseEvent e){}
  213. public void mousePressed(MouseEvent e){}
  214. public void mouseExited(MouseEvent e){}
  215. public void mouseEntered(MouseEvent e){}
  216.  
  217. });
  218.  
  219. JButton button_viewprofile = new JButton("View Profile");
  220. button_viewprofile.setFont(new Font("Waffle Light", Font.BOLD, 24));
  221. button_viewprofile.setBounds(345, 610, 117, 29);
  222. frame.getContentPane().add(button_viewprofile);
  223.  
  224. button_viewprofile.addMouseListener(new MouseListener(){
  225. public void mouseReleased(MouseEvent e){
  226. //action
  227. }
  228. public void mouseClicked(MouseEvent e){}
  229. public void mousePressed(MouseEvent e){}
  230. public void mouseExited(MouseEvent e){}
  231. public void mouseEntered(MouseEvent e){}
  232.  
  233. });
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240. }
  241. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement