Get Some Free Products at your Door Step. Just feed ur Address in dis Link...!!

Showing posts with label FlowLayout type Frame in Java. Show all posts
Showing posts with label FlowLayout type Frame in Java. Show all posts

Tuesday, November 8, 2011

FlowLayout type Frame in Java

import java.awt.Color;
import javax.swing.*;
public class FlowLayout
{
JFrame f = new JFrame("FlowLayout");
JPanel p = new JPanel();
JButton b1 = new JButton("button1");
JButton b2 = new JButton("button2");
JButton b3 = new JButton("button3");
public static void main(String ar[])
{
FlowLayout fl = new FlowLayout();
fl.show();
}
public void show()
{
p.add(b1);
p.add(b2);
p.add(b3);
p.setBackground(Color.BLUE);
f.getContentPane().add(p);
f.setSize(500,500);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}