/* * 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 PanelDemo3 { public JFrame f; public JPanel p,p2,p3,p4,p5,p6,p7; public JButton b1,b2,b3,b4,b5; public PanelDemo3(){ f=new JFrame("Flow Layout Demo"); p= new JPanel(); b1= new JButton("INSERT"); b2= new JButton("UPDATE"); b3= new JButton("DELETE"); b4= new JButton("SELECT"); b5= new JButton("CLOSE"); } public void launchFrame(){ f.getContentPane().setLayout(new BorderLayout(5,1)); f.getContentPane().add(b1, BorderLayout.NORTH); f.getContentPane().add(b2, BorderLayout.SOUTH); f.getContentPane().add(b3, BorderLayout.CENTER); f.getContentPane().add(b4, BorderLayout.EAST); f.getContentPane().add(b5, BorderLayout.WEST); 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) { PanelDemo3 guiWindow2=new PanelDemo3(); guiWindow2.launchFrame(); } }