Java JScrollPane buildLabeledScroller(String label, Component contents)

Here you can find the source of buildLabeledScroller(String label, Component contents)

Description

build Labeled Scroller

License

Apache License

Declaration

public static JScrollPane buildLabeledScroller(String label, Component contents) 

Method Source Code


//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;
    }
}

Related

  1. addStyle(JScrollPane jScrollPane, String labelName)
  2. applyCorrectViewPosition(JComponent targetComponent, JScrollPane scrollPane)
  3. bindHorizontalScrolling(JScrollPane jScrollPane1, JScrollPane jScrollPane2)
  4. createJScrollPane(JComponent component)
  5. createScrollPane(JComponent content)
  6. createSelfManagedScrollPane(final Component view, final JComponent parentToRevalidate)
  7. defaultAutoScroll(JComponent comp, Point cursorLocn)