Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Toolkit;
import java.awt.datatransfer.StringSelection;

public class Main {
    public static void main(String[] argv) throws Exception {
    }

    // This method writes a string to the system clipboard.
    public static void copyToSystemClipboard(String str) {
        StringSelection ss = new StringSelection(str);
        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
    }
}