Here you can find the source of buildLabeledScroller(String label, Component contents)
public static JScrollPane buildLabeledScroller(String label, Component contents)
//package com.java2s; //License from project: Apache License import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; import java.awt.*; public class Main { public static JScrollPane buildLabeledScroller(String label, Component contents) { JScrollPane ret = new JScrollPane(contents); ret.setBorder(buildLabeledBorder(label)); return ret; }// w w w . ja va2 s.c om public static Border buildLabeledBorder(String label) { TitledBorder ret = new TitledBorder(new EtchedBorder(), label); return ret; } }