Here you can find the source of buildInfoPanelTextBorderScroll(final JComponent content, final String title)
public static JComponent buildInfoPanelTextBorderScroll(final JComponent content, final String title)
//package com.java2s; /******************************************************************************* * Copyright (c) 2015, 2017 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://ww w . ja v a 2s . c om * Dr. Alexander Kerner - initial API and implementation *******************************************************************************/ import java.awt.BorderLayout; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JScrollPane; public class Main { public static JComponent buildInfoPanelTextBorderScroll(final JComponent content, final String title) { final JPanel result = new JPanel(new BorderLayout()); result.setBorder(BorderFactory.createTitledBorder(title)); final JScrollPane scroll = new JScrollPane(content); result.add(scroll, BorderLayout.CENTER); return result; } }