Example usage for javax.swing JEditorPane setTransferHandler

List of usage examples for javax.swing JEditorPane setTransferHandler

Introduction

In this page you can find the example usage for javax.swing JEditorPane setTransferHandler.

Prototype

@BeanProperty(hidden = true, description = "Mechanism for transfer of data to and from the component")
public void setTransferHandler(TransferHandler newHandler) 

Source Link

Document

Sets the TransferHandler , which provides support for transfer of data into and out of this component via cut/copy/paste and drag and drop.

Usage

From source file:org.apache.tika.gui.TikaGUI.java

private void addWelcomeCard(JPanel panel, String name) {
    try {/*  w w w  .j  a v  a  2  s  .c o m*/
        JEditorPane editor = new JEditorPane(TikaGUI.class.getResource("welcome.html"));
        editor.setContentType("text/html");
        editor.setEditable(false);
        editor.setBackground(Color.WHITE);
        editor.setTransferHandler(new ParsingTransferHandler(editor.getTransferHandler(), this));
        panel.add(new JScrollPane(editor), name);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:org.apache.tika.gui.TikaGUI.java

private JEditorPane addCard(JPanel panel, String type, String name) {
    JEditorPane editor = new JTextPane();
    editor.setBackground(Color.WHITE);
    editor.setContentType(type);// w  w  w . j a v a2  s  .  c  o m
    editor.setTransferHandler(new ParsingTransferHandler(editor.getTransferHandler(), this));
    panel.add(new JScrollPane(editor), name);
    return editor;
}