i want to add scroll bar to scroll this page..this page is user log-in form... to add more fields i have to add scroll bar how can i do so ..pls help
package user;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import javax.swing.*;
public class form extends JFrame
package user;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import javax.swing.*;
public class form extends JFrame
{
JLabel pic,pic2;
JLabel l1,l2,l3,l4,l5,p1,l7,l8,l9,l10;
JTextField t1,t2,t3,t5,t7,t8,t9,t10;
JPasswordField t6;
JTextArea t4;
JPanel p;
JComboBox combo;
String[] year= new String [4];
public form()
{
setLayout(null);
ImageIcon i=new ImageIcon("green_background.jpg");
pic=new JLabel(i);
pic.setBounds(0,0,1500,1000);
/*Container p=getContentPane();
// p.setBounds(0,0,1500,1000);
add(p);
JScrollPane scrollPane = new JScrollPane(p);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setBounds(0,0,1500,1000);
p.add(scrollPane);*/
ImageIcon i2=new ImageIcon("rform.jpg");
pic2=new JLabel(i2);
pic2.setBounds(270,0,800,1000);
l1=new JLabel("FirstName :");
l1.setBounds(400,160,150,30);
Font f=new Font("Lucida Handwriting",Font.ITALIC|Font.BOLD,20);
l1.setFont(f);
add(l1);
t1=new JTextField(20);
t1.setBounds(600,160,350,30);
add(t1);
l2=new JLabel("LastName :");
l2.setBounds(400,220,150,30);
l2.setFont(f);
add(l2);
t2=new JTextField(20);
t2.setBounds(600,220,350,30);
add(t2);
l3=new JLabel("FatherName :");
l3.setBounds(400,280,170,30);
l3.setFont(f);
add(l3);
t3=new JTextField(20);
t3.setBounds(600,280,350,30);
add(t3);
l4=new JLabel("Adress :");
l4.setBounds(400,340,150,30);
l4.setFont(f);
add(l4);
t4=new JTextArea(3,1);
t4.setBounds(600,340,350,70);
add(t4);
l5=new JLabel("UserName:");
l5.setBounds(400,440,150,30);
l5.setFont(f);
add(l5);
t5=new JTextField(20);
t5.setBounds(600,440,350,30);
add(t5);
p1=new JLabel("Password:");
p1.setBounds(400,500,150,30);
p1.setFont(f);
add(p1);
t6=new JPasswordField(20);
t6.setEchoChar('#');
t6.setBounds(600,500,350,30);
add(t6);
l7=new JLabel("Date Of Birth:");
l7.setBounds(400,560,180,30);
l7.setFont(f);
add(l7);
t7=new JTextField(20);
t7.setBounds(600,560,350,30);
add(t7);
/*String[] date={"1","2","3"};
combo=new JComboBox(date);
combo.setBackground(Color.GRAY);
combo.setBackground(Color.BLUE);
combo.setBounds(600,560,50,30);
add(combo);*/
l8=new JLabel("Contact No:");
l8.setBounds(400,620,170,30);
l8.setFont(f);
add(l8);
t8=new JTextField(20);
t8.setBounds(600,620,350,30);
add(t8);
l9=new JLabel("Class :");
l9.setBounds(400,680,170,30);
l9.setFont(f);
add(l9);
String[] year={"1st year","2nd year ","3rd year","4th year"};
combo=new JComboBox(year);
combo.setBackground(Color.GRAY);
combo.setBackground(Color.WHITE);
combo.setBounds(600,680,350,30);
add(combo);
l10=new JLabel("College :");
l10.setBounds(400,740,170,30);
l10.setFont(f);
add(l10);
//add(p);
add(pic2);
add(pic);
}
public static void main(String args[])
{
form f=new form();
f.setSize(1500,1100);
f.setVisible(true);
}
}