package nl.tudelft.simulation.dsol.swing.gui; import javax.swing.JPanel; import javax.swing.border.TitledBorder; /** * JPanel with an outline and a name. Code based on OpenTrafficSim project component with the same purpose. *

* Copyright (c) 2020-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See * for project information DSOL Manual. The DSOL * project is distributed under a three-clause BSD-style license, which can be found at * DSOL License. *

* @author Alexander Verbraeck * @author Peter Knoppers */ public class LabeledPanel extends JPanel { /** */ private static final long serialVersionUID = 20141222L; /** * Create a JPanel with border and caption. * @param caption String; the caption of the LabeledPanel */ public LabeledPanel(final String caption) { setBorder(new TitledBorder(null, caption, TitledBorder.LEADING, TitledBorder.TOP, null, null)); } /** {@inheritDoc} */ @Override public String toString() { return "LabeledPanel [caption=" + ((TitledBorder) getBorder()).getTitle() + "]"; } }