Ejemplo n.º 1
0
  public hostelStatus() {
    setTitle("Hostel");
    connect();
    updateRecord();

    JFrame fr = new JFrame();
    Toolkit tkt = fr.getToolkit();
    Dimension frsize = tkt.getScreenSize();
    setBounds(frsize.width / 4, frsize.height / 12, frsize.width / 2, frsize.height / 8);
    setLayout(null);

    cn = getContentPane();
    cn.setBackground(new Color(190, 180, 170));

    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    tl = new JLabel("Current Hostels Status");
    tl.setFont(new Font("Engravers MT", 1, 25));
    tl.setForeground(new Color(247, 251, 249));

    p1 = new JPanel();
    p1.setBounds(0, 0, 600, 50);
    p1.add(tl);
    p1.setBackground(new Color(31, 88, 166));
    cn.add(p1);

    b1 = new JButton("LOAD");
    b1.setMnemonic('L');
    b1.addActionListener(new dispListener());
    b1.setBounds(230, 320, 120, 30);

    b2 = new JButton("EXIT");
    b2.setMnemonic('X');
    b2.addActionListener(new exitListener());
    b2.setBounds(350, 320, 100, 30);

    cn.add(b1);
    cn.add(b2);

    table = new JTable(data, col);
    table.setFont(new Font("Serif", Font.BOLD, 16));
    table.setBackground(new Color(250, 250, 250));
    table.setEnabled(false);

    JScrollPane jsp = new JScrollPane(table);
    jsp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    jsp.setBounds(5, 100, 590, 200);
    cn.add(jsp);

    screensize = Toolkit.getDefaultToolkit().getScreenSize();

    setSize(600, 400);
    setVisible(true);
    setVisible(true);
    setResizable(true);
    connect();
  }
Ejemplo n.º 2
0
  public p2() throws Exception {

    // setBorder(BorderFactory.createEtchedBorder(Color.lightGray, Color.DARK_GRAY));
    p = new JPanel();
    // setBackground(Color.white);
    p.setLayout(new GridLayout(11, 3));
    p.setBounds(0, 20, 309, 130);

    un = new JLabel("*  Username");
    ps1 = new JLabel("*  Password");
    ps2 = new JLabel("*  Confirm Password");
    fn = new JLabel("*  First Name");
    ln = new JLabel("   Last Name");
    eid = new JLabel("*  Email ID");
    mb = new JLabel("*  Mobile");
    cct = new JLabel("*  Current City");
    hquali = new JLabel("*  Highest Qualification");
    dob = new JLabel("   DOB");
    dober = new JLabel();
    dd = new JLabel("DD");
    mm = new JLabel("MM");
    yy = new JLabel("YY");
    member = new Label("     already a member?");
    member.addMouseListener(this);

    er1 = new Label("");
    er2 = new Label("");
    er3 = new Label("");
    er4 = new Label("");
    er5 = new Label("");
    er6 = new Label("");
    er7 = new Label("");
    er8 = new Label("");
    er9 = new Label("");
    er10 = new Label("");

    un1 = new JTextField(15);
    ps11 = new JPasswordField(15);
    ps21 = new JPasswordField(15);
    fn1 = new JTextField(15);
    ln1 = new JTextField(15);
    eid1 = new JTextField(15);
    mb1 = new JTextField(15);
    cct1 = new JTextField(15);
    hquali1 = new JTextField(15);
    dober1 = new JTextField(2);
    dober2 = new JTextField(2);
    dober3 = new JTextField(2);

    sub = new JButton("Sign up");
    sub.setBorderPainted(false);
    sub.setFocusable(true);
    sub.addActionListener(this);

    dober.setLayout(new FlowLayout());
    dober.add(dober1);
    dober.add(dd);
    dober.add(dober2);
    dober.add(mm);
    dober.add(dober3);
    dober.add(yy);

    p.add(fn);
    p.add(fn1);
    p.add(er1);
    p.add(ln);
    p.add(ln1);
    p.add(er2);
    p.add(un);
    p.add(un1);
    p.add(er3);
    p.add(ps1);
    p.add(ps11);
    p.add(er4);
    p.add(ps2);
    p.add(ps21);
    p.add(er5);
    p.add(eid);
    p.add(eid1);
    p.add(er6);
    p.add(mb);
    p.add(mb1);
    p.add(er7);
    p.add(cct);
    p.add(cct1);
    p.add(er8);
    p.add(hquali);
    p.add(hquali1);
    p.add(er9);
    p.add(dob);
    p.add(dober);
    p.add(er10);

    p.add(sub);
    p.add(member);
    add(p);
  }