frame Scrollbar

import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
public class ScrollBarDemo2 extends JFrame {
	JPanel p1;
	JButton b1[];
	JScrollPane sp;
	public ScrollBarDemo2() {
		setSize(500, 500);
		p1 = new JPanel();
		sp = new JScrollPane(p1);
		p1.setLayout(new FlowLayout());
		b1 = new JButton[100];
		for (int i = 0; i < b1.length; i++) {
			p1.add(b1[i] = new JButton("Button " + i));
	public static void main(String[] args) {
		new ScrollBarDemo2();


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

Share your valuable comment

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