Here you can find the source of createPaletteJPanel(String title)
Parameter | Description |
---|---|
title | the title of the panel (null allowed) |
public static JPanel createPaletteJPanel(String title)
//package com.java2s; import java.awt.GridLayout; import javax.swing.BorderFactory; import javax.swing.JPanel; public class Main { /**/*from w ww. ja v a2s. co m*/ * Create a panel with a border and title * * @param title the title of the panel (null allowed) * @return the panel that got created */ public static JPanel createPaletteJPanel(String title) { JPanel panel = new JPanel(); if (title != null) { panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), title)); } else { panel.setBorder(BorderFactory.createEtchedBorder()); } panel.setLayout(new GridLayout(0, 1)); return panel; } }