The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

// set the particular position on a screen
lbl.setBounds(200,50,500,100);
lbl.setHorizontalAlignment(lbl.CENTER );
// set the font of lbl label
lbl.setFont(f);

// initializa all the label which are declared in the example above with its caption name
lblid=new JLabel("ID");
lblname=new JLabel("NAME");
lbldepartment=new JLabel("DEPARTMENT");
lbldays=new JLabel("N0. OF DAYS ");
lblrate=new JLabel("RATE PER DAY");
lblsalary=new JLabel("SALARY");
lblstat=new JLabel("CIVIL STATUS");

// To add tooltip in the buttons
btnadd.setToolTipText("Click this button to Add record in the Database.");
btnsave.setToolTipText("Click this button to Save record in the Database.");
btnupdate.setToolTipText("Click this button to Update record in the Database.");
btndelete.setToolTipText("Click this button to Delete record in the Database.");

// set a particular position on a Frame
btnadd.setBounds(200,400,100,30);
btnsave.setBounds(310,400,100,30);
btnupdate.setBounds(420,400,100,30);
btndelete.setBounds(530,400,100,30);

// To add tooltip in the buttons
btnfirst.setToolTipText("Click this button to move to the First Record.");
btnnext.setToolTipText("Click this button to move to the Next Record.");
btnprev.setToolTipText("Click this button to move to the Previous Record.");
btnlast.setToolTipText("Click this button to move to the Last Record.");

// set a particular position on a screen with setbounds constructor
btnfirst.setBounds(200,440,100,30);
btnnext.setBounds(310,440,100,30);
btnprev.setBounds(420,440,100,30);
btnlast.setBounds(530,440,100,30);

btncompute=new JButton("Compute");
btncompute.setToolTipText("Click this button to compute the salary of the employee.");
btncompute.setBounds(360,350,100,30);
add(btncompute);
btncompute.addActionListener(this);