Example usage for javax.swing JScrollPane setBorder

List of usage examples for javax.swing JScrollPane setBorder

Introduction

In this page you can find the example usage for javax.swing JScrollPane setBorder.

Prototype

@BeanProperty(preferred = true, visualUpdate = true, description = "The component's border.")
public void setBorder(Border border) 

Source Link

Document

Sets the border of this component.

Usage

From source file:VASSAL.configure.TextConfigurer.java

public java.awt.Component getControls() {
    if (p == null) {
        p = new JPanel();
        p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
        textArea = new JTextArea(6, 20);
        if (wordWrap) {
            textArea.setLineWrap(true);/*from  w  w  w .  j  av  a2 s  .  co  m*/
            textArea.setWrapStyleWord(true);
        }
        textArea.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                queueForUpdate(textArea.getText());
            }
        });
        textArea.setText((String) getValue());
        JScrollPane scroll = new ScrollPane(textArea);
        if (name != null) {
            scroll.setBorder(new TitledBorder(name));
        }
        p.add(scroll);
    }
    return p;
}