Example usage for javax.swing JTextPane setAutoscrolls

List of usage examples for javax.swing JTextPane setAutoscrolls

Introduction

In this page you can find the example usage for javax.swing JTextPane setAutoscrolls.

Prototype

@BeanProperty(bound = false, expert = true, description = "Determines if this component automatically scrolls its contents when dragged.")
public void setAutoscrolls(boolean autoscrolls) 

Source Link

Document

Sets the autoscrolls property.

Usage

From source file:Main.java

/**
 * Creates a new <code>JTextPane</code> object with the given properties.
 *
 * @param text The text which will appear in the text pane
 * @param backgroundColor The background color
 * @return A <code>JTextPane</code> object
 *//*  w w  w .  j a  v a2  s . com*/
public static JTextPane createJTextPane(String text, Color backgroundColor) {
    JTextPane jTextPane = new JTextPane();
    jTextPane.setBorder(null);
    jTextPane.setEditable(false);
    jTextPane.setBackground(backgroundColor);
    jTextPane.setFont(new Font("Times New Roman", Font.PLAIN, 14));
    if (text != null) {
        jTextPane.setText(text);
    }
    jTextPane.setVerifyInputWhenFocusTarget(false);
    jTextPane.setAutoscrolls(false);
    return jTextPane;
}

From source file:hr.fer.zemris.vhdllab.view.LogHistoryView.java

@Override
protected JComponent createControl() {
    JTextPane textPane = new JTextPane();
    textPane.setEditable(false);/*from  www  .ja v a  2s.  c o m*/
    textPane.setAutoscrolls(true);

    setupLogAppender(textPane);

    return new JScrollPane(textPane);
}