Guest User

Untitled

a guest
Aug 3rd, 2012
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.78 KB | None | 0 0
  1. import javax.swing.JFrame;
  2. import javax.swing.JPanel;
  3. import javax.swing.border.EmptyBorder;
  4. import javax.swing.JLabel;
  5. import java.awt.Font;
  6. import javax.swing.JTextField;
  7. import javax.swing.JSeparator;
  8. import javax.swing.JButton;
  9. import java.awt.Color;
  10. import javax.swing.SwingConstants;
  11.  
  12.  
  13. @SuppressWarnings("serial")
  14. public class View extends JFrame {
  15.  
  16.     private JPanel contentPane;
  17.     private JTextField from2;
  18.     private JTextField from1;
  19.     private JTextField from3;
  20.     private JTextField from4;
  21.     private JTextField to1;
  22.     private JTextField to2;
  23.     private JTextField to3;
  24.     private JTextField to4;
  25.     private JButton btnDoIt;
  26.     private JLabel lblstatus;
  27.  
  28.     /**
  29.      * Create the frame.
  30.      */
  31.     public View() {
  32.         setResizable(false);
  33.        
  34.         setTitle("IP Range Generator by M2G");
  35.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  36.         setBounds(100, 100, 433, 300);
  37.         contentPane = new JPanel();
  38.         contentPane.setBackground(Color.DARK_GRAY);
  39.         contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  40.         setContentPane(contentPane);
  41.         contentPane.setLayout(null);
  42.        
  43.         JLabel lblFrom = new JLabel("From:");
  44.         lblFrom.setForeground(Color.GREEN);
  45.         lblFrom.setFont(new Font("Tahoma", Font.PLAIN, 12));
  46.         lblFrom.setBounds(27, 24, 46, 14);
  47.         contentPane.add(lblFrom);
  48.        
  49.         JSeparator separator = new JSeparator();
  50.         separator.setBounds(89, 66, 15, 2);
  51.         contentPane.add(separator);
  52.        
  53.         JSeparator separator_1 = new JSeparator();
  54.         separator_1.setBounds(198, 66, 15, 2);
  55.         contentPane.add(separator_1);
  56.        
  57.         JSeparator separator_2 = new JSeparator();
  58.         separator_2.setBounds(311, 66, 15, 2);
  59.         contentPane.add(separator_2);
  60.        
  61.         JSeparator separator_3 = new JSeparator();
  62.         separator_3.setBounds(89, 136, 15, 2);
  63.         contentPane.add(separator_3);
  64.        
  65.         JSeparator separator_4 = new JSeparator();
  66.         separator_4.setBounds(198, 136, 15, 2);
  67.         contentPane.add(separator_4);
  68.        
  69.         JSeparator separator_5 = new JSeparator();
  70.         separator_5.setBounds(311, 136, 15, 2);
  71.         contentPane.add(separator_5);
  72.        
  73.         from2 = new JTextField();
  74.         from2.setBounds(127, 54, 52, 20);
  75.         contentPane.add(from2);
  76.         from2.setColumns(10);
  77.        
  78.         from1 = new JTextField();
  79.         from1.setColumns(10);
  80.         from1.setBounds(27, 54, 52, 20);
  81.         contentPane.add(from1);
  82.        
  83.         from3 = new JTextField();
  84.         from3.setColumns(10);
  85.         from3.setBounds(232, 54, 52, 20);
  86.         contentPane.add(from3);
  87.        
  88.         from4 = new JTextField();
  89.         from4.setColumns(10);
  90.         from4.setBounds(336, 54, 52, 20);
  91.         contentPane.add(from4);
  92.        
  93.         to1 = new JTextField();
  94.         to1.setColumns(10);
  95.         to1.setBounds(27, 128, 52, 20);
  96.         contentPane.add(to1);
  97.        
  98.         to2 = new JTextField();
  99.         to2.setColumns(10);
  100.         to2.setBounds(127, 128, 52, 20);
  101.         contentPane.add(to2);
  102.        
  103.         to3 = new JTextField();
  104.         to3.setColumns(10);
  105.         to3.setBounds(232, 128, 52, 20);
  106.         contentPane.add(to3);
  107.        
  108.         to4 = new JTextField();
  109.         to4.setColumns(10);
  110.         to4.setBounds(336, 128, 52, 20);
  111.         contentPane.add(to4);
  112.        
  113.         JLabel lblTo = new JLabel("To:");
  114.         lblTo.setForeground(Color.GREEN);
  115.         lblTo.setFont(new Font("Tahoma", Font.PLAIN, 12));
  116.         lblTo.setBounds(27, 103, 46, 14);
  117.         contentPane.add(lblTo);
  118.        
  119.         btnDoIt = new JButton("Do It!");
  120.         btnDoIt.setBounds(127, 181, 157, 31);
  121.         contentPane.add(btnDoIt);
  122.        
  123.         lblstatus = new JLabel("Ready!");
  124.         lblstatus.setForeground(Color.GREEN);
  125.         lblstatus.setHorizontalAlignment(SwingConstants.CENTER);
  126.         lblstatus.setFont(new Font("Tahoma", Font.PLAIN, 13));
  127.         lblstatus.setBounds(127, 234, 157, 14);
  128.         contentPane.add(lblstatus);
  129.         setVisible(true);
  130.         validate();
  131.         setLocationRelativeTo(null);
  132.     }
  133.  
  134.     public JTextField getFrom2() {
  135.         return from2;
  136.     }
  137.  
  138.     public void setFrom2(JTextField from2) {
  139.         this.from2 = from2;
  140.     }
  141.  
  142.     public JTextField getFrom1() {
  143.         return from1;
  144.     }
  145.  
  146.     public void setFrom1(JTextField from1) {
  147.         this.from1 = from1;
  148.     }
  149.  
  150.     public JTextField getFrom3() {
  151.         return from3;
  152.     }
  153.  
  154.     public void setFrom3(JTextField from3) {
  155.         this.from3 = from3;
  156.     }
  157.  
  158.     public JTextField getFrom4() {
  159.         return from4;
  160.     }
  161.  
  162.     public void setFrom4(JTextField from4) {
  163.         this.from4 = from4;
  164.     }
  165.  
  166.     public JTextField getTo1() {
  167.         return to1;
  168.     }
  169.  
  170.     public void setTo1(JTextField to1) {
  171.         this.to1 = to1;
  172.     }
  173.  
  174.     public JTextField getTo2() {
  175.         return to2;
  176.     }
  177.  
  178.     public void setTo2(JTextField to2) {
  179.         this.to2 = to2;
  180.     }
  181.  
  182.     public JTextField getTo3() {
  183.         return to3;
  184.     }
  185.  
  186.     public void setTo3(JTextField to3) {
  187.         this.to3 = to3;
  188.     }
  189.  
  190.     public JTextField getTo4() {
  191.         return to4;
  192.     }
  193.  
  194.     public void setTo4(JTextField to4) {
  195.         this.to4 = to4;
  196.     }
  197.  
  198.     public JButton getBtnDoIt() {
  199.         return btnDoIt;
  200.     }
  201.  
  202.     public void setBtnDoIt(JButton btnDoIt) {
  203.         this.btnDoIt = btnDoIt;
  204.     }
  205.  
  206.     public JLabel getLblstatus() {
  207.         return lblstatus;
  208.     }
  209.  
  210.     public void setLblstatus(String alblstatus) {
  211.         lblstatus.setText(alblstatus);
  212.     }
  213. }
Advertisement
Add Comment
Please, Sign In to add comment