/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author STUDENT */ import java.awt.*; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class PanelDemo2 { public JFrame f; public JPanel p,p2,p3,p4,p5,p6,p7; public JButton b1,b2,b3,b4,b5; public PanelDemo2(){ f=new JFrame("Flow Layout Demo"); p= new JPanel(); b1= new JButton("Update"); b2= new JButton("Update"); b3= new JButton("Delete"); b4= new JButton("Select"); b5= new JButton("Close"); } public void launchFrame(){ p.setLayout(new FlowLayout(1,2,2)); p.add(b1); p.add(b2); p.add(b3); p.add(b4); p.add(b5); f.getContentPane().add(p); f.setSize(500,500); f.setDefaultCloseOperation(f.EXIT_ON_CLOSE); f.pack(); f.setVisible(true); } /** * @param args the command line arguments */ public static void main(String[] args) { PanelDemo2 guiWindow2= new PanelDemo2(); guiWindow2.launchFrame(); } }