Example usage for java.awt BorderLayout SOUTH

List of usage examples for java.awt BorderLayout SOUTH

Introduction

In this page you can find the example usage for java.awt BorderLayout SOUTH.

Prototype

String SOUTH

To view the source code for java.awt BorderLayout SOUTH.

Click Source Link

Document

The south layout constraint (bottom of container).

Usage

From source file:Main.java

public TestPane() {
    setLayout(new BorderLayout());
    tree = new JTree();
    File rootFile = new File(".");
    DefaultMutableTreeNode root = new DefaultMutableTreeNode(rootFile);
    model = new DefaultTreeModel(root);

    tree.setModel(model);//from   ww w.ja  v a 2s  .  co  m
    tree.setRootVisible(true);
    tree.setShowsRootHandles(true);

    add(new JScrollPane(tree));

    JButton load = new JButton("Load");
    add(load, BorderLayout.SOUTH);

    load.addActionListener(e -> {
        DefaultMutableTreeNode r = (DefaultMutableTreeNode) model.getRoot();
        root.removeAllChildren();
        model.reload();
        File f = (File) r.getUserObject();
        addFiles(f, model, r);
        tree.expandPath(new TreePath(r));
    });
}

From source file:ImageLoader.java

public ImageLoader() {
    super("Image Loader");

    this.log = new JTextArea(4, 4);
    this.viewer = new JPanel();

    JButton start = new JButton("Start");
    start.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String[] files = new String[] { "Bodie_small.png", "Carmela_small.png", "Death Valley_small.png",
                    "Lake_small.png" };
            new ImageLoadingWorker(log, viewer, files).execute();
        }//from  w w  w  . j  av  a 2 s . c om
    });

    add(new JScrollPane(log), BorderLayout.NORTH);
    add(new JScrollPane(viewer), BorderLayout.CENTER);
    add(start, BorderLayout.SOUTH);

    setSize(360, 280);
}

From source file:Main.java

public Main() {
    JPanel sliderPanel = new JPanel();
    sliderPanel.setLayout(new GridLayout(0, 1));
    for (int i = 0; i < slider.length; i++) {
        labels[i] = new Label(colorNames[i] + 255);
        sliderPanel.add(labels[i]);/*from ww w.j a  va2s.c o  m*/
        slider[i] = new JSlider(SwingConstants.HORIZONTAL, 0, 255, 255);
        slider[i].setMinorTickSpacing(10);
        slider[i].setMajorTickSpacing(50);
        slider[i].setPaintTicks(true);
        slider[i].setPaintLabels(true);
        sliderPanel.add(slider[i]);
    }
    lb = new Label("Colour");
    dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog.setModal(true);
    dialog.add(sliderPanel, BorderLayout.CENTER);
    dialog.add(lb, BorderLayout.SOUTH);
    dialog.pack();
    dialog.setLocation(200, 200);
    dialog.setTitle("Colour Dialog");
    dialog.setVisible(true);
}

From source file:SimpleInternalFrameDemo.java

public SimpleInternalFrameDemo() {
    super("Internal Frame Demo");
    setSize(500, 400);/*from   w w  w  .j  a  va 2 s.c o m*/
    openButton = new JButton("Open");
    macButton = new JButton("Mac");
    javaButton = new JButton("Metal");
    motifButton = new JButton("Motif");
    winButton = new JButton("Windows");
    Panel p = new Panel();
    p.add(openButton);
    p.add(macButton);
    p.add(javaButton);
    p.add(motifButton);
    p.add(winButton);
    add(p, BorderLayout.SOUTH);
    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });
    openButton.addActionListener(new OpenListener());
    LnFListener lnf = new LnFListener(this);
    macButton.addActionListener(lnf);
    javaButton.addActionListener(lnf);
    motifButton.addActionListener(lnf);
    winButton.addActionListener(lnf);

    // Set up the layered pane
    desktop = new JDesktopPane();
    desktop.setOpaque(true);
    add(desktop, BorderLayout.CENTER);
}

From source file:Main.java

public Main() {
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(new JButton("Foo"));
    buttonPanel.add(Box.createHorizontalStrut(10));
    buttonPanel.add(new JButton("Bar"));

    String[] columnNames = { "Mon", "Tues", "Wed" };
    DefaultTableModel model = new DefaultTableModel(columnNames, 25);
    JTable table = new JTable(model);
    JScrollPane scrollPane = new JScrollPane(table);
    scrollPane.getViewport().setPreferredSize(table.getPreferredSize());

    JLabel southLabel = new JLabel("OK!");
    southLabel.setForeground(Color.white);
    JPanel southPanel = new JPanel();
    southPanel.add(southLabel);//from   w  w  w. ja  v a2  s  .  c om

    setLayout(new BorderLayout(5, 5));
    add(buttonPanel, BorderLayout.NORTH);
    add(scrollPane, BorderLayout.CENTER);
    add(southPanel, BorderLayout.SOUTH);
}

From source file:TabbedPane1.java

public void init() {
    for (int i = 0; i < flavors.length; i++)
        tabs.addTab(flavors[i], new JButton("Tabbed pane " + i));
    tabs.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            txt.setText("Tab selected: " + tabs.getSelectedIndex());
        }//from  w w  w .  j a va  2  s. c om
    });
    Container cp = getContentPane();
    cp.add(BorderLayout.SOUTH, txt);
    cp.add(tabs);
}

From source file:Ellipse.java

public Ellipse() {
    super();//  w  w w. jav a2  s. c o m
    Container container = getContentPane();

    canvas = new DrawingCanvas();
    container.add(canvas);

    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(1, 2));
    panel.add(new JLabel("x,y: ", JLabel.RIGHT));
    location = new JLabel("");
    panel.add(location);

    container.add(panel, BorderLayout.SOUTH);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });
    setSize(600, 300);
    setVisible(true);
}

From source file:JBenchFrame.java

public JBenchFrame() {
    this.getContentPane().setLayout(borderLayout1);
    this.setSize(new Dimension(400, 300));
    fillButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            ListData ld = new ListData();
            long tmStart = System.currentTimeMillis();
            list1.setModel(ld);//from  w w w.  ja  v a 2 s.co m
            list1.repaint();
            long tmEnd = System.currentTimeMillis();
            System.out.println(tmEnd - tmStart);

        }
    });
    fillButton.setText("Fill");
    this.getContentPane().add(new JScrollPane(list1), BorderLayout.CENTER);
    this.getContentPane().add(fillButton, BorderLayout.SOUTH);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    setVisible(true);
}

From source file:Main.java

public JComponent makeUI() {
    UIManager.put("TabbedPane.tabInsets", new Insets(2, 2, 2, 50));
    final JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("A", new JPanel());

    JPanel p = new JPanel(new BorderLayout());
    p.add(new JLayer<JTabbedPane>(tabbedPane, new CloseableTabbedPaneLayerUI()));
    p.add(new JButton(new AbstractAction("add tab") {
        @Override//  w w w. j  a v a 2 s  . c  o  m
        public void actionPerformed(ActionEvent e) {
            tabbedPane.addTab("test", new JPanel());
        }
    }), BorderLayout.SOUTH);
    return p;
}

From source file:BufferedImageThread.java

public BufferedImageThread() {
    super();/*from ww w.  j  a va  2s  . c o  m*/
    Container container = getContentPane();

    canvas = new AnimationCanvas();
    container.add(canvas);

    startButton = new JButton("Start Animation");
    startButton.addActionListener(new ButtonListener());
    stopButton = new JButton("Stop Animation");
    stopButton.addActionListener(new ButtonListener());
    JPanel panel = new JPanel();
    panel.add(startButton);
    panel.add(stopButton);
    container.add(BorderLayout.SOUTH, panel);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });
    setSize(450, 425);
    setVisible(true);
}