import java.awt.*; public class BorderLayout3 { public static void main(String args[]) { Frame f = new Frame(); f.setLayout(new BorderLayout()); Panel toolbar = new Panel(); toolbar.setLayout(new FlowLayout(FlowLayout.LEFT)); toolbar.setBackground(Color.lightGray); toolbar.add(new Button("File")); toolbar.add(new Button("Edit")); toolbar.add(new Button("Tool")); toolbar.add(new Button("Help")); f.add(toolbar, BorderLayout.NORTH); TextField status = new TextField("Status."); status.setFont(new Font("Monospaced", Font.BOLD, 48)); f.add(status, BorderLayout.SOUTH); f.add(status, BorderLayout.SOUTH); f.setSize(300,300); f.setVisible(true); } }
Comments
Post a Comment