Jump to content

rizal

Members
  • Content Count

    249
  • Joined

  • Last visited

Posts posted by rizal


  1. import javax.swing.*;
    import java.awt.*;
    import javax.swing.border.*;
    
    public class cuba extends JFrame {
    	public cuba (){
    JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEFT,2,6));
    JLabel lblid = new JLabel("Staff ID   :");
    JTextField  tfid= new JTextField(15);
    JLabel lblname = new JLabel("Name      :");
    JTextField  tfname= new JTextField(15);
    JLabel lbljob = new JLabel("Job ID     :");
    JTextField  tfjob= new JTextField(15);
    JLabel lblic = new JLabel("IC Num       :");
    JTextField  tfic= new JTextField(14);
    JLabel lbladd = new JLabel("Address 1             :");
    JTextField  tfadd= new JTextField(15);
    JLabel lbladd2 = new JLabel("Address 2            :");
    JTextField  tfadd2= new JTextField(15);
    JLabel lbladd3 = new JLabel("Address 3            :");
    JTextField  tfadd3= new JTextField(15);
    JLabel lblcon = new JLabel("Contact No.         :");
    JTextField  tfcon= new JTextField(15);
    JLabel lblposition = new JLabel("Position               :");
    JTextField  tfposition= new JTextField(15);
    JLabel lbldep = new JLabel("Department Name:");
    JTextField  tfdep= new JTextField(14);
    p1.add(lblid);
    p1.add(tfid);
    p1.add(lblname);
    p1.add(tfname);
    p1.add(lbljob);
    p1.add(tfjob);
    p1.add(lblic);
    p1.add(tfic);
    p1.add(lbladd);
    p1.add(tfadd);
    p1.add(lbladd2);
    p1.add(tfadd2);
    p1.add(lbladd3);
    p1.add(tfadd3);
    p1.add(lblcon);
    p1.add(tfcon);
    p1.add(lblposition);
    p1.add(tfposition);
    p1.add(lbldep);
    p1.add(tfdep);
    p1.setBorder(new TitledBorder("STAFF INFORMATION"));
    add(p1);
    setLayout(new GridLayout(2,6,5,5));
    pack();
    setSize(580,380);
    JPanel p2 = new JPanel(new FlowLayout(FlowLayout.CENTER));
    JButton jbtview = new JButton("VIEW");
    JButton jbtinsert = new JButton("INSERT");
    JButton jbtdelete = new JButton("DELETE");
    JButton jbtupdate = new JButton("UPDATE");
    JButton jbtsearch = new JButton("SEARCH");
    p2.add(jbtview);
    p2.add(jbtinsert);
    p2.add(jbtdelete);
    p2.add(jbtupdate);
    p2.add(jbtsearch);
    p2.setBorder(new TitledBorder(""));
    setLayout(new GridLayout(1,1,2,2)); 
    add(p2);
    	}
    public static void main(String[]args){
    	JFrame frame = new cuba();
    	frame.setTitle("Staff Information");
    	frame.setLocationRelativeTo(null);
    	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	//frame.setSize(500,600);
    	frame.setVisible(true);
    }
    }
    

    alignment dia lari.sesiapa ada idea tolong sayer.


  2. amik stpm lah... sakit memang sakit, tapi hasilnyaa..... perghh..... member aku dan aku keduanya stpm.time stpm jgn main2!!! ala setaun setengah lah.sakit tengok org lain enjoy.tapi ingatlah kita boleh enjoy abis bila dah amik degreee.tahanla sket.kalau indon diberi peluang amik stp, nescaya depa amik gak!

    *dari budak stpm aliran sc dgn result x seberapa.skang dah kaya!

×
×
  • Create New...