Java Swing Border setViewportBorder(JScrollPane scrollPane, int vertical, int horizontal)

Here you can find the source of setViewportBorder(JScrollPane scrollPane, int vertical, int horizontal)

Description

set Viewport Border

License

Open Source License

Declaration

public static void setViewportBorder(JScrollPane scrollPane, int vertical, int horizontal) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.BorderFactory;

import javax.swing.JScrollPane;

public class Main {
    public static void setViewportBorder(JScrollPane scrollPane, int vertical, int horizontal) {
        scrollPane.setViewportBorder(BorderFactory.createMatteBorder(vertical, horizontal, vertical, horizontal,
                scrollPane.getViewport().getView().getBackground()));
    }/*from  w  w w. j a v a  2 s  . c o m*/
}

Related

  1. setBorder(Border b, JComponent... components)
  2. setBorder(JComponent comp, boolean setBorder, Color col)
  3. setBorder(JComponent comp, Border border)
  4. setDebugBorder(final JComponent component)
  5. setDefaultComponentsTabOrder(Vector v)
  6. showBorder(JComponent c, Color color)
  7. suppressBorders(JComponent comp)