/* Layout1b.java * * Uses a method to add hard coded button sizes. */ import java.awt.*; class Layout1b { public static void main( String [] args ) { Frame frame = new Frame( "Layout1" ); frame.setLayout(null); /* Original style Button button1 = new Button("Next"); frame.add(button1); button1.setBounds(10,30,50,25); */ newButton( frame, "Next", 10, 30, 50, 25 ); newButton( frame, "Previous", 70, 30, 50, 25 ); frame.setVisible(true); } static void newButton( Frame f, String name, int x, int y, int w, int h ) { Button b = new Button(name); f.add(b); b.setBounds(x,y,w,h); } }