Example usage for javax.swing JPanel JPanel

List of usage examples for javax.swing JPanel JPanel

Introduction

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

Prototype

public JPanel(LayoutManager layout, boolean isDoubleBuffered) 

Source Link

Document

Creates a new JPanel with the specified layout manager and buffering strategy.

Usage

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JPanel buttonPanel = new JPanel(new FlowLayout(), true);
    buttonPanel.add(new JButton("A"));

    frame.add(buttonPanel);/* www. j  a va2 s  .co  m*/

    frame.setSize(300, 200);
    frame.setVisible(true);
}