Example usage for javax.swing JTextPane setVisible

List of usage examples for javax.swing JTextPane setVisible

Introduction

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

Prototype

@BeanProperty(hidden = true, visualUpdate = true)
public void setVisible(boolean aFlag) 

Source Link

Document

Makes the component visible or invisible.

Usage

From source file:org.owasp.jbrofuzz.fuzz.ui.FuzzingPanel.java

private JTextPane createEditablePane() {

    JTextPane textPane = new JTextPane();

    // Get the preferences for wrapping lines of text
    final boolean wrapText = JBroFuzz.PREFS.getBoolean(JBroFuzzPrefs.FUZZING[2].getId(), false);

    if (wrapText) {
        textPane = new JTextPane();
    } else {/*from w w  w .j  a  v a2  s. c o  m*/
        textPane = new NonWrappingTextPane();
    }

    textPane.putClientProperty("charset", "UTF-8");
    textPane.setEditable(true);
    textPane.setVisible(true);
    textPane.setFont(new Font("Verdana", Font.PLAIN, 12));
    textPane.setMargin(new Insets(1, 1, 1, 1));
    textPane.setBackground(Color.WHITE);
    textPane.setForeground(Color.BLACK);

    // Set the editor kit responsible for highlighting
    textPane.setEditorKit(new StyledEditorKit() {

        private static final long serialVersionUID = -6085642347022880064L;

        public Document createDefaultDocument() {
            return new TextHighlighter();
        }

    });

    // Right click: Cut, Copy, Paste, Select All
    RightClickPopups.rightClickRequestTextComponent(this, textPane);

    return textPane;
}