Example usage for javax.swing JTextArea paste

List of usage examples for javax.swing JTextArea paste

Introduction

In this page you can find the example usage for javax.swing JTextArea paste.

Prototype

public void paste() 

Source Link

Document

Transfers the contents of the system clipboard into the associated text model.

Usage

From source file:MainClass.java

public static void main(final String args[]) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JTextArea leftTextArea = new JTextArea();
    frame.add(leftTextArea);/*  w  ww  .ja v a2 s  .c o  m*/
    leftTextArea.paste();

    frame.setSize(250, 150);
    frame.setVisible(true);

}

From source file:Main.java

public static void main(String args[]) {
    JFrame frame = new JFrame();
    Container content = frame.getContentPane();

    content.setLayout(new GridLayout(0, 2));

    JTextArea leftTextArea = new JTextArea();
    content.add(leftTextArea);/*from www.  ja  v a 2 s  .c  om*/
    leftTextArea.paste();

    frame.setSize(250, 150);
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String args[]) {
    String title = (args.length == 0 ? "TextArea Example" : args[0]);
    JFrame frame = new JFrame(title);
    Container content = frame.getContentPane();

    content.setLayout(new GridLayout(0, 2));

    JTextArea leftTextArea = new JTextArea();
    content.add(leftTextArea);/*from  ww w  .  ja va  2 s . c  o m*/
    leftTextArea.paste();

    JTextArea rightTextArea = new JTextArea() {
        public boolean isManagingFocus() {
            return false;
        }
    };
    rightTextArea.paste();

    JScrollPane rightPane = new JScrollPane(rightTextArea);
    content.add(rightPane);

    frame.setSize(250, 150);
    frame.setVisible(true);
}