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.

Similar Messages

  • Copy an image into system clipboard takes too much memory

    Our Swing application copies a java.awt.BufferedImage into the system clipboard. Our image has a size of 1024x768 pixels and a depth of 24 bits per pixel.
    The copy from the image to the system clipboard works, but is very slow and takes too much memory. Before the copy, java.exe uses about 30 MB. After the copy, it uses about 90 MB! However, a 1024x768x3 image should consume only 2,4 MB.
    We did some debugging and it seems the AWT library does several copies of our original image in order to copy it in the system clipboard. I guess that each of these copies takes a lot of memory (probably because of a different format from the original image) and is not immediately garbage collected.
    This is a big issue for our application because the JVM throws an OutOfMemoryError when we try to copy a new image to the system clipboard.
    Here is our code. Do you have any idea? Thanks a lot for your help.
    // Create the image
    BufferedImage image = new BufferedImage(1024, 768, BufferedImage.TYPE_3BYTE_BGR);
    Graphics2D g2 = image.createGraphics();
    drawSomething(g2);
    g2.dispose();
    // Put the image into the system clipboard
    ImageSelection handler = new ImageSelection(image);
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    clipboard.setContents(handler, handler);
    * An implementation of Transferable and ClipboardOwner to be used with
    * images.
    public class ImageSelection implements Transferable, ClipboardOwner {
        private static final DataFlavor flavors[] = {DataFlavor.imageFlavor};
        private Image image;
        public ImageSelection(Image imageToCopy) {
            this.image = imageToCopy;
        // Interface ClipboardOwner
        public void lostOwnership(Clipboard clipboard, Transferable transferable) {
            image = null;
        // Interface Transferable
        public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,
                                                                IOException {
            if (isDataFlavorSupported(flavor)) {
                return image;
            else {
                throw new UnsupportedFlavorException(flavor);
        public DataFlavor[] getTransferDataFlavors() {
            return flavors;
        public boolean isDataFlavorSupported(DataFlavor flavor) {
            return flavor.equals(flavors[0]);
    }

    why dont u use other data structure to store the image , which will take less memory.

  • After recording text using the dragon dictation app, it is converted, it can be copied to the iOS system clipboard for use in any app, how does the user access the clipboard to retrive this information if it is no longer on the screen?

    after recording text using the Dragon dictation app, it can be copied to the iOS systme clipboard for use in any app, how does the user access the clipboard to retrive this information if it is no longer on the screen?

    You need to do a long-press in any data entry field, then select Paste.

  • In the past, I have had no problem copying from a network HDD to my Mac.  Recently, I cannot copy and get error code 8084.  Any thoughts?

    I cannot copy from my network drive to my iMac; I get error code 8084.  I can copy the same material from my network drive to my PC.  In the past, I have had no troubl copying to my iMac. What happened-going from OS 10.6.7 to 10.6.8?

    Thread bump.

  • I have problem copy from Adobe Reader to MS Word

    I copied text from pdf and when phasted onto MS Word, it turns out funny characters.

    Probably, the font used isn't installed in your system, and the creator of the PDF file didn't embed it properly.

  • Module Pool screen copy from 4.7 system to 4.5 system

    Hi can any body tell me how can i upload screens from 4.7 environment to 4.5 environment.
    Due to version incompatable i am unable to do.

    Hi
    I've downloaded the file from dynpro, the first lines are:
      THIS FILE IS GENERATED BY THE SCREEN PAINTER.
      NEVER CHANGE IT MANUALLY, PLEASE !
    %_DYNPRO
    SAPMF05A
    0100
    700                <---- Basis SAP Release
    Try to change the version and insert the rel of 4.50
    Max

  • Problems copying from 23.98 to 29.97 timebase

    I edited footage shot with a 24p camera (Panasonic AG-DVX100A) at 23.98 frames a second. When I tried to copy and paste my sequence into a project with a 29.97 timebase, in several places gaps appeared between shots. Has anyone encountered this, or does anyone know how to fix it? Thanks!

    Best not to start a whole new thread, Jim. It will just lead to repetition and confusion...
    For those of you following along at home, the thread is here:
    http://discussions.apple.com/message.jspa?messageID=1834358#1834358
    Patrick

  • 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)

  • How to copy a structure from one SAP system to other SAP system in ABAP

    Hi All,
      We have a requriement where need to copy an strcture of 250 feilds from on SAP system to other SAP system , do any one know how to do it .
    Regards
    Channu

    Channappa,
    It is really not hard to manually create the structure. Ctrl-Y copy from the source system screen and paste in the target system screen. You'll have to do this one page at a time. So, you will have to repeat it 9 times (or 18 times if you have to copy/paste component list and type separately).
    I can assure you that you can finish the task in less than 30 minutes.

  • BW System copy from PRD to DEV - Reduce database size

    Hi All
    We are in the process of copying our existing Production BW system (3.5) to become a new Development & test system. We want to reduce the database size significantly from 1.4 Tb to about 150 - 200 Gb. We have deleted all cube and ODS data as well as much of the master data but still have much tablespace tied up in monitor entries (eg table RSMONMESS) and IDOCs. All of the notes I read say that we cannot delete from RSMONMESS in a "Prodcution" environment, however we are creating a new DEV system and really need to get rid of monitor entries anyway. So there are two questions:
    1. Any idea how we can clear up table RSMONMESS or delete unwanted monitor entries ?
    2. How can we delete IDOCs copied from our production system without archiving them ? (They are of no use in our new test system.)
    Please help.
    Many thanks in anticipation.
    Paul Sullivan
    Orica IT

    Hi Paul,
    See SAP Note 694895 - Performance and tables RSMON, RSDONE
    Note Language: English Version: 5 Validity: Valid Since 29.11.2005
    Summary
    Symptom
    Tables RSMON* (for example, table RSMONMESS) and tables RS*DONE (for
    example, table RSSELDONE) continuously increase in size in the BW system
    with each request that is created.
    Currently there is no option to reduce these tables.
    Do not delete any entries from these tables. If you did, this would have
    the following consequences:
    When you carry out the next check for the requests for which you have
    deleted records from these tables, the check will not run properly.
    The status of the relevant requests turns RED in the monitor, and also in
    all affected data targets that contain the request.
    The affected request and all subsequent requests are no longer visible in
    the reporting - all queries on the affected data targets then only display
    old data.
    Numerous dumps will occur in various situations.
    You will not be able to repair the errors caused by the deletion.
    More Terms
    RSMONMESS; RSSELDONE; Performance; RSMON; RSDONE;
    Cause and Prerequisites
    This is caused by a program error.
    Solution
    In the next BW release (BI in SAP NetWeaver 2004s - that is BW 7.0), you
    will be able to archive entries from the RSMON* and RS*DONE tables using a
    request archiving process that archives the administrative information for
    requests.
    After archiving, these tables are then considerably reduced in size.
    Until then, there is unfortunately no option for reducing the tables.
    Rgds,
    Colum

  • Copying to the system clipboard

    Hi...
    I am trying to copy the contents of a JPanel to the system clipboard so I can paste it into an app like MS Word. The JPanel just has some lines and dots on it that I've drawn with draw and fillOval.
    I am VERY new to Java so the only way I could figure out to do this was to save the contents of the panel as a .jpg and then wrap it up in a class I created that implements the transferrable interface. This works....and I can paste it into Word and it looks fine on the screen. But when I print it.....it looks very grainy. So I'd like to be able to copy this panel to the clipboard in some other way besides saving it as an image first.
    Is there any other direct way to copy components like a panel with shapes drawn on it to the system clipboard that anyone knows of?
    Thanks in advance!
    Julie

    Thanks for the suggestion. I tried it...but it still looks like crap when I print it.
    I am drawing directly on a Graphics2D object (the exact size I want), then I put into a BufferedImage. Then I save the BufferedImage as a .png, open it back up and copy it to the system clipboard.
    It is just the image quality. Is there a way to manipulate the DPI?
    Thanks again,
    Julie

  • Problems pasting from Excel 2008 to Numbers

    I'm trying to make the switch from Excel to numbers and ran into the following problem.
    If I cut a group of cells from Excel 2008 and try paste it into Numbers it does not work.
    I can paste into another place in Excel, Stickies or OpenOffice, but not Numbers.
    I can double click a cell in Numbers and paste all the copied into a single cell, but this is not what I want.
    Is this a Numbers problem or Excel 2008. Since I can paste from Excel to programs other than Numbers, it seems like a Numbers problem
    Anyone else have this problem.
    Cheers!

    Very weird! I don't think your table is too simple.
    I tried a simple table and it failed.
    In fact I can copy the table from Numbers and paste it into Excel 2008
    But when I copy the same table from Excel and try to paste into Numbers, it fails.
    I can however paste into stickies.
    *Copy from Numbers*
    *Paste into Excel 2008- No Problem*
    *Copy from Excel 2008*
    *Paste into Numbers - nothing!*
    *Paste into a singe cell - Fine*
    *Paste into Stickies - Fine*
    AAARRRRGGGHHH

  • 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.

  • Bug? - Spaces missing when copying from Adobe Reader

    I have found that when attempting to copy text from some documents (in Adobe Reader)on IOS, to paste into a writer program, that all the spaces are missing.
    There is not aproblem with the same document / Adobe reader on my Windows PC.
    There was also not a problem copying from the same document using another reader (ios FileBrowser native reader), then pasting.
    I quick Google found that I was not alone...
    https://groups.google.com/forum/#!msg/plaintext/2Bs49s1K9_o/KTwelaiqEIsJ
    This link lays out the issue, not common to all IOS PDF readers, with a solution: use another reader.
    Is there a solution for this in Adobe Reader, or how can it be reported to Adobe?

    There are no spaces there. That is not how pdf files are constructed. HOWEVER, on PCs and Macs, the applications are smart enough to figure that spaces should be inserted into the text being copied. The iOS app is not smart enough to figure out on certain pdfs that it should insert spaces on copying from those problemsome pdfs. Adobe does have a feature request/bug reporting form where you can report the problem:
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • Dear ladies and gentlemen! I recently received on my notebook, operating system 8.1, the message "Adobe Acrobat is no longer working properly". I also found myself that I can copy from einerPDF file excerpts not without problems in another document. My Ad

    Dear ladies and gentlemen!
    I recently received on my notebook, operating system 8.1, the message "Adobe Acrobat is no longer working properly". I also found myself that I can copy from einerPDF file excerpts not without problems in another document. My Adobe Acrobat 9 Pro has released version 9.0.0. Two updates this version is not listed. Please inform me how I can fix this problem.
    Sincerely, Walter Hacksteiner
    mailto: [email protected]

    The first thing I would try is to update Acrobat 9 to the latest version 9.5.5
    The next thing would be to run Acrobat 9 in Windows 7 or Vista or XP Compatibility Mode.

Maybe you are looking for

  • Hi guys (very urgent pls help me out)

    i have an doubt that iam using JBoss AS, my scienraio is inital when start my Application Server it will connects to mysql DB datasource, i will retrieve some values those are DB Names like oracle,sql server,db2 etc in my JSP page iam placed at combo

  • How to show dock in full screen mode

    Hello, I'm wondering how to get the dock to show up temporarily in full screen mode. When I place my cursor near the bottom of the screen in a full screen app, the dock doesn't pop up. Is this normal and if so, how do I switch between full screen app

  • What I should do If I move fact and dimension tables from one server to other server

    Hi I have question like what all changes need to be done  in EPM System if we move the Fact and Dimension tables to a different server.            Reply me asap and thanks in advance

  • Bookmark

    Hi guys, I have the following problem with bookmarks. The bookmarks store navigation state of the web template. The problem is, if I create a couple bookmarks und after that I change something in the web template (e.g.  add additional dropdown item)

  • Total value change

    Hello all: I find something wrong with my GR,so i use movement type 102 to do reverse but the total value different from GR What can cause this error,someone can gave some advice? Edited by: king xin on Dec 21, 2010 6:11 AM