Frame Scrollbar

import java.awt.Adjustable;
import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
public class ScrollBarDemo1 extends JFrame 
{
JScrollBar hs,vs;
JPanel p1;
JButton b1[];
	public ScrollBarDemo1()
	{
	super("Win");
	setSize(500,500);
	setDefaultCloseOperation(EXIT_ON_CLOSE);
	hs=new JScrollBar(Adjustable.HORIZONTAL);
	vs=new JScrollBar(Adjustable.VERTICAL);
	add(hs,BorderLayout.SOUTH);
	add(vs,BorderLayout.EAST);
	p1=new JPanel();
	add(p1,BorderLayout.CENTER);
	b1=new JButton[100];
	for(int i=0;i<b1.length;i++)
	{
		p1.add(b1[i]=new JButton("Button "+i));
	}
	setVisible(true);
	}
	public static void main(String[] args) 
	{
		new ScrollBarDemo1();
	}
}

Download

Frame in Swing

Simple Frame
Frame with Panel
Frame Menu Event ans Color Chooser
Frame with Panel and Button
TextField and TextArea
Combobox in Frame
Change Icon of Frame
Scrollbar in Frame
Scrollbar in Frame
Add picture in Frame
Label in Frame
Toggle Buttons in frame
Radio Buttons in Frame


Write your Comment

Name :
Email Id : [ We will not publish your email id ]
Your Comment : [ Maximum 200 chars ]
Enter Security code