Example usage for javax.swing JButton setLayout

List of usage examples for javax.swing JButton setLayout

Introduction

In this page you can find the example usage for javax.swing JButton setLayout.

Prototype

public void setLayout(LayoutManager mgr) 

Source Link

Document

Sets the layout manager for this container, refer to java.awt.Container#setLayout(LayoutManager) for a complete description of this method.

Usage

From source file:JXTransformer.java

private JPanel createStressTestPanel() {
        JPanel panel = new JPanel();
        TitledBorder titledBorder = BorderFactory.createTitledBorder("Stress test (with tooltips)");
        titledBorder.setTitleJustification(TitledBorder.CENTER);
        panel.setBorder(titledBorder);/* ww  w .  j  av  a2s .  c  om*/
        JButton lowerButton = new JButton("Button");
        lowerButton.setLayout(new FlowLayout());
        lowerButton.setToolTipText("Lower button");
        JButton middleButton = new JButton();
        middleButton.setToolTipText("Middle button");
        middleButton.setLayout(new FlowLayout());
        lowerButton.add(middleButton);
        JButton upperButton = new JButton("Upper button");
        upperButton.setToolTipText("Upper button");
        middleButton.add(upperButton);
        panel.add(createTransformer(lowerButton));
        return panel;
    }