System clipboard

How can i access or grant access to the system clipboard to an applet ???

Clipboard c = getToolkit().getSystemClipboard();

Similar Messages

  • Need to save the image saved in the System Clipboard in using JDK 1.3.1

    Does anyone know how to use JDK 1.3.1 to take an image saved in the System clipboard and save it to a file using the JPG format?
    I know how it is done in JDK 1.4 using the following code. Unfortunately, the same code does not recognize the image in the clipboard in JDK 1.3.1
    I am using jai-1_1_2_01.
    package clipboard;
    import java.awt.datatransfer.Clipboard;
    import java.awt.datatransfer.DataFlavor;
    import java.awt.datatransfer.Transferable;
    import java.awt.image.RenderedImage;
    import java.awt.Toolkit;
    import java.awt.datatransfer.UnsupportedFlavorException;
    import java.io.IOException;
    import java.io.FileOutputStream;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import javax.media.jai.JAI;
    import javax.media.jai.RenderedOp;
    public class clipboard
    {  private File tempFile = null;
    * @param args
    static int BUFFER_SIZE = 65536;
    public static void main(String[] args)
    {  clipboard clip = new clipboard();
    clip.writeImageFromClipboard();
    public void writeImageFromClipboard()
    {  Clipboard            clip = Toolkit.getDefaultToolkit().getSystemClipboard();
    Transferable transferable = clip.getContents(null);
    RenderedImage img = null;
    FileOutputStream fileOutStr = null;
    BufferedOutputStream bufOutStr = null;
    DataFlavor [] dataFlavors;
    File tempFile;
    int
    byteCount;
    String [] strArr;
    dataFlavors = transferable.getTransferDataFlavors();
    System.out.println("clip=" + clip.getName());
    System.out.println("Transferable=" + transferable);
    for (int i = 0; i < dataFlavors.length; i++)
    {  System.out.println("dataFlavours[" + i + "]=" + dataFlavors.toString());
    if (transferable.isDataFlavorSupported(new DataFlavor("image/x-java-image; class=java.awt.Image", "Image")))
    { try
    { img = (RenderedImage) transferable.getTransferData(new DataFlavor("image/x-java-image; class=java.awt.Image", "Image"));
    if (this.tempFile == null)
    { this.tempFile = File.createTempFile("__TMP_IMG__", ".jpg");
    System.out.println(this.tempFile.getCanonicalPath());
    fileOutStr = new FileOutputStream(this.tempFile);
    bufOutStr = new BufferedOutputStream(fileOutStr);
    // Encode the file as a JPG image.
    JAI.create("encode", img, bufOutStr, "JPEG", null);
    catch (UnsupportedFlavorException e)
    { e.printStackTrace();
    catch (IOException e)
    { e.printStackTrace();
    finally
    { if (bufOutStr != null)
    { try
    { bufOutStr.flush();
    bufOutStr.close();
    catch (IOException e)
    if (fileOutStr != null)
    { try
    { fileOutStr.flush();
    fileOutStr.close();
    catch (IOException e)
    else
    { System.out.println("Not an image!");

    The login  you connected to the server  and run the above statement does not have permissions to operate  on this path "C:\Users\ISLLCdba\Desktop\MAA
    PROFILE PICTURES\"
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Problems copying from PJC to system clipboard

    I am working on a PJC to allow for editing of large text fields (> 64K). I have most of the functionality working fine. However, I am having a problem using cut, copy, and paste.
    Some details, the PJC extends VBean and includes as JTextArea. Our users want a right click menu to provide functionality for cutting, copying, pasting, and spell checking. I was able to get the spell check working using JSpell. I am not able to get the menu entries for cut, copy, and paste to work. I construct a JPopMenu with the appropriate items. When the menu is activated, if the user selects cut, the actionPerformed method executed the cut method of the JTextArea. This does cut the text from the item, however it is not added to the clipboard for use in other items, except those that have the same implementation class of the original item. If the user uses the keyboard (CTRL-X, CTRL-C, or CTRL-V) the selected data is copied to the system clipboard
    Here is the method I used to create the menu items:
      private JMenuItem makeMenuItem(String label, char acceleratorKey)
        JMenuItem item = new JMenuItem(label);
        item.addActionListener(this);
        item.setMnemonic(acceleratorKey);
        item.addKeyListener(this);
        printDebugMessage("Horizontal text alignment = " + item.getHorizontalAlignment());
        item.setHorizontalAlignment(SwingConstants.LEFT);
        printDebugMessage("Horizontal text alignment = " + item.getHorizontalAlignment());
        return item;
      }Here is the actionPerformed method:
      public void actionPerformed(ActionEvent ae)
        String selection = ae.getActionCommand();
        if (selection.equals("Cut"))
          printDebugMessage("Cut selected");
          text.cut();
        else if (selection.equals("Copy"))
          printDebugMessage("Copy selected");
          text.copy();
        else if (selection.equals("Paste"))
          printDebugMessage("Paste selected");
          text.paste();
        else if (selection.equals("Spell Check"))
          printDebugMessage("Spell Check selected");
          doSpellCheck();
      }I read that jar files needed to be signed to interact with the desktop, but when I signed the jar file the results were the same.
    Platform
    10g AS on Solaris 10.1.2.2
    Windows XP (SP2)
    IE7
    Sun plugin 1.5.0_11 (problem also occurs with 1.4.2_06)
    Any insights would be helpful.
    Thanks

    will that create a problem?Try it and see.

  • Signed Applet JTextField copy to system clipboard

    Hi all,
    We have a signed and deployed our JAR file that contains our applet following the instructions listed at:
    http://java.sun.com/products/plugin/1.3/docs/rsa_signing.html
    We used Thwate as our CA. All seemed good.
    However any JTextFields that are in our applet cannot access the system clip board. Looking at the source for JTextComponent it should have access to the system clipboard if the securitymanager allows it.
    The strange thing is that if I call getToolkit().getSystemClipboard() from our applets I can access the clipboard and copy to the system clipboard. Even the code in JTextComponent that checks for system clipboard access (canAccessSystemClipboard) works fine when pasted into the applet.
    Why cant a JTextField copy to the clipboard? Has anyone else come across this?

    Juste an idea.... Is your JTextField belonging to the javax.swing.... packages ?
    Or did you compile using some com.ms , ibm.... sun... package ? This could lead to some different implementations.

  • Writing on system clipboard from an applet.

    Is it possible?
    I have tried to write on it but an exception is occoured:
    java.security.AccessControlException: access denied (java.awt.AWTPermission accessClipboard)
    The code that I have used is:
    import java.security.*;
    import java.awt.*;
    import java.awt.datatransfer.*;
    import javax.swing.*;
    public class Blah extends JApplet {
    public void init() {
    String exampleStr = "Hi!";
    Clipboard clipboard;
    Transferable trans;
    StringSelection strSelect;
    try {
    SecurityManager security = System.getSecurityManager();
    if (security != null)
    security.checkSystemClipboardAccess();
    clipboard=Toolkit.getDefaultToolkit().getSystemClipboard();
    strSelect = new StringSelection(exampleStr);
    trans = (Transferable)strSelect;
    clipboard.setContents(trans, strSelect);
    System.out.println("Clipboard copy successful");
    catch (Exception e) {
    System.err.println("Clipboard copy failed");
    System.err.println(e);
    Thanks

    First, your applet must be signed to access the system clipboard. And on Netscape 4.7.x, you need to enable the privilege from within the same method where you get the system clipboard. On IE 5.5/6.0, signing the applet is all that is necessary.
    Here's what I do on Netscape:
    Make sure when you call "PrivilegeManager.enablePrivilege("UniversalSystemClipboardAccess");", that you get the system clipboard within the same method. Failure to do this will cause a ForbiddenTargetException.
    My code looks like:
    public java.awt.datatransfer.Clipboard getSystemClipboard()
    java.awt.datatransfer.Clipboard clipboard = null;
    try
    PrivilegeManager.enablePrivilege("UniversalSystemClipboardAccess");
    clipboard = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
    PrivilegeManager.revertPrivilege("UniversalSystemClipboardAccess");
    catch (netscape.security.ForbiddenTargetException se)
    se.printStackTrace();
    catch(Exception e)
    e.printStackTrace();
    return clipboard;
    This works successfully on Netscape 4.7.8. On IE 5.5/6.0, I didn't have to do anything other than having a signed applet to get the system clipboard. With the code above, I also am using a signed applet.
    Hope this helps anyone else trying to make this work.
    -Dave.

  • Paste Image to System Clipboard

    Hello all...I can't paste an Image to the system clipboard and was wondering if you could help me. Noticed there was some help on this topic with JDK 1.4.1, however I'm using JDK 1.3.1.
    I following code was copied from Sun at http://developer.java.sun.com/developer/Books/GJ21AWT/ch20.pdf
    but I cant get it to work.
    <code>
    //implement the class like this
    ImageSelection is = new ImageSelection(Constants.DRAWINGSLATE.currentImage.pBitmap[dList.ptr].getImage());
    toolkit.getSystemClipboard().setContents(is, null);
    class ImageSelection implements ClipboardOwner, Transferable
    public static DataFlavor ImageFlavor;
    public static DataFlavor ImageArrayFlavor;
    private DataFlavor[] flavors = {ImageFlavor, ImageArrayFlavor};
    private java.awt.Image image;
    private int width, height;
    static
    try
    ImageFlavor = new DataFlavor(Class.forName("java.awt.Image"),"AWT Image");
    ImageArrayFlavor = new DataFlavor("image/gif", "GIF Image");
    catch(Exception e)
    public ImageSelection(Image image)
    this.image = image;
    public ImageSelection(Image image, int width, int height)
    this.image = image;
    this.width = width;
    this.height = height;
    public synchronized DataFlavor[] getTransferDataFlavors()
    return flavors;
    public boolean isDataFlavorSupported(DataFlavor flavor)
    return flavor.equals(ImageFlavor) || flavor.equals(ImageArrayFlavor);
    public synchronized Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException
    if (flavor.equals(ImageFlavor))
    return image;
    if (flavor.equals(ImageArrayFlavor))
    return imageToArray();
    else
    throw new UnsupportedFlavorException(flavor);
    public void lostOwnership(Clipboard c, Transferable t)
    private int[] imageToArray()
    int[] pixels = new int[width*height];
    PixelGrabber pg = new PixelGrabber(image, 0, 0, width, height, pixels, 0 , width);
    try
    pg.grabPixels();
    catch(InterruptedException e)
    e.printStackTrace();
    return pixels;
    </code>
    I get this exception
    Couldn't write data flavor java.awt.datatransfer.DataFlavor[representationclass=java.awt.Image;mimetype=application/x-java-serialized-object] to clipboard:
    java.io.IOException: Transferable's flavor data is of unexpected class com.apple.mrj.internal.awt.graphics.VImage
    Thanks for any help.

    I was trying to use ur code with slight modification
    import java.awt.*;
    import java.awt.datatransfer.*;
    import java.io.*;
    import java.util.*;
    public class Test {
    public static void main (String[] parameters) {
              new Test ().test ();
    private void test () {
    Toolkit.getDefaultToolkit().getSystemClipboard ().setContents (          new mageTransferable ("test.jpg"),
         new ClipboardOwner () {
         public void lostOwnership (                                             Clipboard clipboard,
                             Transferable contents) {}
    private class ImageTransferable implements Transferable {
    private String fileName;
    public ImageTransferable (String fileName) {
    System.out.println(" Checking for the File now");
    if (! new File(fileName).exists ()) {
    throw new IllegalArgumentException ("Can't find image");
    System.out.println(" got the file");
    this.fileName = fileName;
    System.out.println(" returning from constructor");
    public Object getTransferData (DataFlavor flavor) throws UnsupportedFlavorException {
    System.out.println("trying to get the data to be transfered");
    if (! isDataFlavorSupported (flavor)) {
    throw new UnsupportedFlavorException (flavor);
    System.out.println("This is a supported flavor");
    return (Image)Toolkit.getDefaultToolkit().createImage (fileName);
    //               System.out.println(
    public boolean isDataFlavorSupported (DataFlavor flavor) {
    System.out.println("trying to check whether the flavour is supported one");
    DataFlavor[] df= this.getTransferDataFlavors();
    System.out.println(" data flavors " + df);
    boolean result = in(flavor, df);
    return result;
    public DataFlavor[] getTransferDataFlavors () {
    //     "image/x-java-image; class=java.awt.Image"
    DataFlavor df=null;
    System.out.println("trying to get the data flavours");
    df =new DataFlavor("application/x-java-serialized-object; class=java.awt.Image","Image");
    //new DataFlavor("image/x-java-image;class=java.awt.Image","Image");
    System.out.println(" Just going to return & DF found was"+ df);
    DataFlavor[] df2 = new DataFlavor[]{df,DataFlavor.plainTextFlavor,DataFlavor.stringFlavor,DataFlavor.javaFileListFlavor };
    System.out.println(df2.length);
    System.out.println(df2[0]);
    return df2;
    private boolean in (DataFlavor flavor, DataFlavor[] flavors) {
    System.out.println("Im in in");
    int f = 0;
    while ((f < flavors.length) && ! flavor.equals (flavors[f])) {
         f ++;
         System.out.println("Im in in's loop");
    return f < flavors.length;
    But this throws the following exception:
    Exception in thread "main" java.lang.ClassCastException: sun.awt.windows.WImage
    at sun.awt.windows.WDataTransferer.translateTransferable(WDataTransferer
    .java:346)
    at sun.awt.DataTransferer.translateTransferable(DataTransferer.java:245)
    at sun.awt.windows.WClipboard.setContents(WClipboard.java:69)
    at Test.test(Test.java:13)
    at Test.main(Test.java:8)
    Is the dataflavour purely dependent on OS. What can be done to overcome this problem

  • Applet access to system Clipboard

    Hi all:
    I am creating a customized version of the mud telnet application for a customer. They have requested cut/paste functionality and I have been able to provide this capability. The problem is the applet cannot get access to the system clipboard so all cut/paste functions can only occur within the applet. I am able to access the system clipboard by creating a java.policy file and setting a permission. The problem is that most of the workstations, and a good number that will be using home computers running Win 98. They don't want the users to have to download the new JRE from Sun (although I know this works). I am looking for a way to creat a JAR file using the old JDK 1.1 (or the current toolkit if it is possible) that will allow access from the Applet to the System Clipboard. I have search the web for an answer, with no success. Can anyone give me any suggestions?
    Anybody had to do the same thing before?
    Thanks.
    John Kreiner

    I know this is an old thread, but I thought I would answer it.
    To access the clipboard via an applet, you need to use JavaScript.
    The first thing to do is to create a class that uses reflection to use the JSObject. The reason why reflection is used is because it is a pain (ITA) to specify a compatible binary for eacy java version (e.g. java40.jar, plugin.jar, jaws.jar, etc). Here is the class:
    import java.lang.reflect.*;
    import java.applet.Applet;
    public class JavaScript {
         public static void call(Applet applet, String methodName, Object[] param) {
              try {
                   Class js = Class.forName("netscape.javascript.JSObject");
                   Method callMethod = js.getMethod("call", new Class[] { String.class, Object[].class });
                   callMethod.invoke(getWindow(applet), new Object[] { methodName, param});
              } catch (Throwable t) {}
         public static Object getWindow(Applet applet) {
              Object o = null;
              try {
                   Class js = Class.forName("netscape.javascript.JSObject");
                   Method getWindowMethod = js.getMethod("getWindow", new Class[] { Applet.class });
                   o = getWindowMethod.invoke(null, new Object[] { applet });
              } catch (Throwable t) {}
              return o;
    }Now, when you want to copy something to the clipboard, you will do:
    JavaScript.call(someApplet, "copyToClipboard", text);
    BUT the "copyToClipboard" function has not been defined yet. This will be a JavaScript function in the html:
    <script language="JavaScript1.1">
    function copyToClipboard(text) {
         document.myForm.myInput.value = text;
         var rng = document.myForm.myInput.createTextRange();
         rng.execCommand("RemoveFormat");
         rng.execCommand("Copy");
    </script>And one last thing is that a JavaScript text component is required in order to create the "rng" variable. To do this, use a hidden field in the html:
    <form name="myForm">
         <input name="myInput" type="hidden">
         </input>
    </form>

  • Programatically copy to  System Clipboard

    I'm trying to programatically copy a value from my applet to the system clipboard without much luck. My jars have all been signed and I am able to ctrl-c and ctrl-v to/from the applet/system clipboard. What I need to be able to do is invoke this behaviour from a popup menu. Below is a code snippet:
    public void actionPerformed(ActionEvent event)
                   Object source  = event.getSource();
                   String strValue = source.toString();
                   StringSelection strSelection = new StringSelection(strValue);
                   Toolkit.getDefaultToolkit().getSystemClipboard().setContents( strSelection , strSelection );
                    // at this point I have verified that 't' does indeed contain my item.
                   Transferable t =Toolkit.getDefaultToolkit().getSystemClipboard().getContents(strSelection );
    }When I try to paste into, say notepad, there does not appear to be anything in the clipboard.
    Any idea as to what I'm doing wrong? I'm using 1.5 plugin (but want to move down to 1.4)
    Thanks,
    -Craig Green

    I guess you didn't sign it right or called your method from untrusted (unsigned) code.
    for signing:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post
    for a full trace:
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    for 1.5:
    deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    I think for linux this is somewhere in youruserdir/java (hidden directory)

  • Copying to system clipboard

    i m tryin to copy an image to the system clipboard,. the syntax being the usual
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selectedImage,null);
    i m not invoking the method      javax.swing.SwingUtilities.invokeLater(new Runnable(){
              public void run()
    will that create a problem? cuz i can run it normally wen i m not

    will that create a problem?Try it and see.

  • System clipboard pasting multi lines

    I have a small java snippet that will copy text to the system clipboard. what i need to know is how to make it copy more than one single string to the system clipboard? Any ideas???

    I'm confused. You know how to copy one String to the clipboard but you don't know how to copy two Strings to the clipboard.

  • System clipboard, AWT TextAreas, and JTextAreas

    This code makes a JApplet with a Swing JTextArea and an AWT TextArea. The JTextArea won't accept pasted text that was copied from another application. The AWT TextArea will. Why is this, and how can I get a JTextArea to accept pasted input?
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.util.*;
    public class TextAreaTest extends JApplet {
         Container cp = getContentPane();
         JTextArea TextIn = new JTextArea("You can't paste from the system clipboard into this box.",4,44);
         JScrollPane aScrollPane = new JScrollPane(TextIn);
         TextArea awtTextIn = new TextArea("Pasting into this box does work!",4,44);
         public void init() {
              cp.setLayout(new FlowLayout());
              cp.add(new Label("Copy some text from another program."));
              cp.add(new Label("Click in the upper box and press Shift+Insert."));
              cp.add(new Label("Why is nothing pasted?"));
              cp.add(aScrollPane);
              cp.add(awtTextIn);
    //<applet width="500" height="240" code="TextAreaTest.class"></applet>

    Thanks for checking this and replying. Pasting into the JTextArea from outside doesn't work for me, even when I'm running the applet locally. Even when I run the applet with appletviewer from the command prompt, I still can't paste from the outside into the JTextArea. If I cut from the TextArea or from an outside application and try to paste into the JTextArea, nothing happens. I can't go the other way either: If I cut from the JTextArea and try to paste into the TextArea, nothing happens. The only cutting and pasting that works with the JTextArea is that if I cut from within the JTextArea, I can paste back into the JTextArea.
    I wonder why pasting works for you and not for me. I'm using the latest JDK (1.4.2_03) and JRE on Windows XP. I have the same behavior on a Windows 2000 machine with the 1.4.1 JRE.

  • System Clipboard - I want to check system clipboard

    Hi
    I Want to check system clipboard on regular interval , my forms interact with
    another application in VB , That application send some value to system clipboard
    i want to check if values being send in system clipboard or not , if it has being
    send then my form perform some task.
    I know copy_region and paste_region command but that does not solve the problem.
    i Need to check weither the values has come to system clipboard .
    If u have solution please help .

    Also, if they have your CC info in their iTunes, I suggest giving them an -> iTunes allowance or -> iTunes Gift card instead of the CC info.
    Then you do not have to worry about how much they are spending.

  • FRM-92220: access to system clipboard is denied

    Hi,
    Within a customer's application Error FRM-92220 "access to system clipboard is denied" is returned when the customer switches between screens within the application.
    I have not been able to find a reference for this error nor am I experienced with Forms.
    Can anyone help and give a solution or point into the right direction to help the customer with this error?
    Thanks in advance.
    Peter

    As found in the Internal Support Portal:
    Ideally, the error FRM-92220 will be thrown due to the the reason that there is a security check introduced by the JRE in one of their updates/upgrades sometime around JRE 1.5 was released. If the System clipboard is accessed by another OS application, then JRE cannot access the clipboard hence resulting in the error. If no OS application (like word or anyother tool ) then you wont have this error. Avoiding this error is not in the hands of Forms, its a question of whether JRE can access the clipboard at that particular moment
    In earlier versions like 9.0.4 and 10.1.2, this new security measure by Sun JRE has resulted in Java exceptions and abrupt termination of the JVM in the client machines resulting in Forms disconnection. Hence Forms development introduced the new applet parameter to capture and re-route the messages to the java console
    allowAlertClipboard=true
    Setting it to false, will not show these errors and will sent to jre console.
    There is very little you can with respect to Forms coding. I would recommend you to set the following
    allowAlertClipboard=false
    at the moment when the error comes, the forms process will capture and send it to console. Later, if the System clipboard is released by other processed which were holding it, then the clipboard can be accessed again, there is nothing that you need to do specifically.

  • Massive copy to system clipboard with vim?

    Say I'm editing a program with vim through a terminal (say xterm). Does anyone know how to copy the contents, via left click highlighting, onto the system clipboard (x11) when the content that needs to be copied is physically off the screen? I've tried to arrow up while highlighting but it doesn't work.

    toxic, from what I understand from t-dawg's questions is that he wants to emulate what you can do in gvim, but with vim instead.
    In gvim, I can click the mouse button; hold; drag downwards and then gvim will start scrolling downwards, whilst highlighting the passing lines. This is how you highlight large amounts of text (greater than what can fit in a single screen at a time) with a mouse.
    However, terminals are slightly dumber. Whilst you can highlight areas of text, that's a console function and not something that vim itself is monitoring. Therefore, you can't achieve the same effect with the mouse in vim as you can in gvim.
    Of course, vim is perfectly capable of selecting more text than can fit in a single screen. It has a visual mode. Press v and then move down with your cursor keys, et volia - highlighted text.
    Now when it comes to shifting this to X11's clipboard, I've never tried (hence the link I gave for possible help). I'm sure it can be done.

  • Java - system clipboard problem

    I'm trying to put text from a java program to the system clipboard (OS) and I can't make it work.
    I've included a small code example in this post.
    import java.awt.datatransfer.*;
    import java.awt.*;
    import java.awt.Toolkit.*;
    class ClipTest{
    public static void main(String[] args){
    new ClipTest();
    public ClipTest(){
    StringSelection clip = new StringSelection("hello");
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    clipboard.setContents(clip,clip);
    System.exit(0);
    After running the program I would expect to have "hello" on my System clipboard. But I don't. Nothing has been transfered to the clipboard.
    I'm running java1.3.1 on IRIX and I have tryed Linux as well.
    Am I doing something wrong here? Please enlighten me.

    That's a thought. but take this code example though:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MyTextArea extends JTextArea implements ActionListener{
    JTextArea m_txt;
    JPopupMenu m_menu;
    public MyTextArea(){
    super();
    m_txt=this;
    addMouseListener(new RightMouseListener());
    m_menu = new JPopupMenu("Menu");
    JMenu item = new JMenu("Edit");
    m_menu.add(item);
    JMenuItem item1 = new JMenuItem("Copy");
    item1.addActionListener(this);
    item1.setActionCommand("copy");
    item.add(item1);
    class RightMouseListener extends MouseAdapter{
    public void mouseClicked(MouseEvent e){
    if(e.getModifiers()==InputEvent.BUTTON3_MASK){
    m_menu.show(m_txt, e.getX(),e.getY() );
    public void actionPerformed(ActionEvent e){
    if (e.getActionCommand().equals("copy")) {
    copy();
    If you use this component in a dialog or something, type some text in it, make a selection, righclick and choose copy from the edit menu, I get the same result, and I guess it will work at your Windows platform?

Maybe you are looking for

  • Contacts backup in Win 8.1

    I went to backup my iPhone on my Netbook that has  Windows 8.1.  I happened to notice that it wasn't backing up my contacts because it appears I don't have Outlook or any other Mail program. This Netbook is "Authorized" with my laptop (Win 7 and my d

  • Cash discount

    Dear sir, Im processing invoice FB-70 for customer DM01 with payment term 0002 (14days cash discount 3%, 30days due date). But when I Process partial incoming payment (F-28) for 3 times in 14 first days, it doesnt deduct cash discount for each times

  • Finder Broken

    So I'm pretty sure that the logmein software (logmein.com) has somehow broken my Finder or a link between the System and the Finder. I've uninstalled logmein, but the damage has been done. Here's what's happening... My computer is set to turn on in t

  • UCCX 7.01 LRM service problems

    Hi, we have installed UCCX 7.01 but we are having problems when starting Cisco Desktop Agent appplication. The error we get: “A licensing error has occurred. Please try again in five minutes. If the problem persists, please see your log file or the

  • Mutiple 10g Forms Sessions

    We have a 6i application that may launch up to 4 or 5 forms applications on their desktop. Running on their workstation this is no problem at all. In 10g this establishes 4 or 5 forms sessions on the app server with each session having a significant