Copy JPanel onto clipboard

Hi, I have spent the entire afternoon googling and searching these forums for some ideas and clues as how to go about this, but with no luck. So I have decided to just ask to how it is done.
I have a JFrame applicationWindow that contains 2 JPanels: InputPanel and outputPanel. Both JPanels are created in independant classes as I am trying to achieve a MVC architecture. What I would like to do is have a button in the application window that will copy the output Panel into the system clipboard. The outputPanel conatains only a painComponent() method that draws some lines onto the outputPanel itself.
Could somebody please explain to me how this can be done? I have searched for some examples but nothing that explains it well has come up.
i think i need to use:
          if(arg0.getSource().equals(copyItem))
             Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
             cb.setContents(?,?);  
          }But I am unsure as to what goes inside the brackets of the setContents(). I don't understand the Transferable stuff either...
Sorry if I haven't explained my situation too well, any questions just ask.
Thanks

I've experienced problems copying images to the system clipboard. it would copy however when i got in other software the clipboard would not be compatible because it was java only. if you only need to copy and paste within your app, i suggest you forget those Clipboard classes and just had menus with shortcuts that copy your image/panel/whatever into another object, or pastes it.

Similar Messages

  • How do I copy my old xl files from my XP machine to operate on xl for Mac on my new iMac.  When I copy them onto a stick and transfer them it automatically makes them xls files which are then corrupted when I try to open them in xl for mac

    How do I copy my old xl files from my XP machine to operate on xl for Mac on my new iMac.  When I copy them onto a stick and transfer them it automatically makes them xls files which are then corrupted when I try to open them in xl for mac

    Sorry, yes this is Microsoft Excel.  The Microsoft XP has Excel files denoted as xl, the later versions of Microsoft Excel are denoted as xls files.  The later verions of Microsoft Excel open the xl files OK, does Excel for Mac not able to do this?

  • I have copied videos onto an external hard drive. to free memory on my macbook. When I try to delete these I am warned that I will not be able to use this video in existing projects   How do I point iMovie to events in my external  hard drive so I can pl

    I have copied videos onto an external hard drive. to free memory on my macbook. When I try to delete these I am woarned that I will not be able to use this video in existing projects
    How do I point iMovie to events in my external  hard drive so I can play projects which use them?
    MacBook, iMovie 9.0.4

    Hi
    You can do this - by not doing it the way You describe as it will not work.
    a. the external hard disk - MUST BE - Mac OS extended (hfs) formatted -
    UNIX/DOS/FAT32/Mac OS Exchange - will work for most things - BUT NOT FOR VIDEO (iMovie, iDVD or FinalCut doesn't matter)
    b. Do not alter or move any folder named
    • iMovie Event's - or -
    • iMovie Project's
    on DeskTop/Finder - at all
    All moving's of Events and Projects must be done within the iMovie Application - then connections will not break.
    (move them back and see if iMovie remembers them - then do move as described above)
    Yours Bengt W

  • HT1351 I've encoded a vinyl LP record into digital format and recorded it onto an usb as MP3 file. But when I tried to copy it onto my ipod classic, I get a message stating "was not copied to the ipod because it cannot be played on this ipod". Why?

    I've encoded a vinyl LP record into digital format and recorded it onto an usb as MP3 file. But when I tried to copy it onto my ipod classic, I get a message stating "was not copied to the ipod because it cannot be played on this ipod". Why?

    I was refering to the "sample rate", normally 44.1 KHz, the iPod might not be able to play tracks with a non-standard rate. Otherwise I'm not sure what the issue might be.
    tt2

  • How do I copy the entire contents of my laptops failing hard drive to copy back onto a new computer.

    How do I copy the entire contents of my laptops failing hard drive to copy back onto a new computer.

    If the drive has failed the only way to get any data off it is to send it to a Data Recovery company. Which is very expensive and no guaranty they will be able to retrieve any data.
    That is why Apple has included a system to backup your Mac on a regular basis, Time Machine. Also there are other Apps to do basically the same thing by Cloning your internal drive to an external drive. Carbon Copy Cloner and SuperDuper. Along with using Disk Utility to Image the internal drive to an external drive.
    Sorry to tell you but if the drive has really failed your Data is gone unless you pay a large sum of money to one of the Data recovery companies.

  • How do I copy files onto a hard drive (device) from Mac 2 7 pc. I'm able to transfer files from device but cannot transfer files to device. Anyone had same problem or can help solve this problem? Help pls

    how do I copy files onto a hard drive (device) from Mac 2 7 pc. I'm able to transfer files from device but cannot transfer files to device. Anyone had same problem or can help solve this problem? Help pls

    Welcome to Apple Support Communities
    When you try to copy data to the external drive, what happens? If you don't see any error, the external drive is formatted in NTFS, and OS X can't write in it.
    To be able to write on this external drive, you have to use an app like Paragon NTFS. Another solution would be to format the external drive in FAT32 or exFAT with Disk Utility > http://pondini.org/OSX/DU1.html Make sure you copied all the files of the external disk to the internal disk before doing it

  • I have Photoshop elements 10 and have been trying to copy albums onto a flash drive to show slide show on my TV. 10 does not have a flash drive connection, so I am trying to put it on my harddrive. When I hit the export to harddrive or anything else, I ge

    I have Photoshop elements 10 and have been trying to copy albums onto a flash drive to show slide show on my TV. 10 does not have a flash drive connection, so I am trying to put it on my harddrive. When I hit the export to harddrive or anything else, I get a message saying it is trying to locate and reconnect missing photos, goes into a search mode and displays the identifiers of the located images. When I try to follow the directions for reconnecting I get nowhere. Can you help?

    Wrong forum; we don't do Elements here.
    You want:  Photoshop Elements

  • I have a new mac mini I5 - I cannot find and copy Maverick onto a flash so that I can install on the other 7 iMacs - don't want to download from App store to each machine

    I have a new mac mini I5 - I cannot find and copy Maverick onto a flash so that I can install on the other 7 iMacs - don't want to download from App store to each machine - files too big
    Please assist

    You need to download it on one of the iMacs via App store but not install since after it installs the installation download gets deleted.
    After it is downloaded you can copy to a USB device. You can also make a bootable USB install device by:
    downloading and using DiskMaker X

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

  • More DataFlavors copied to the clipboard/used in D&D in one step

    Hallo,
    For my GUI app. I would like to enable different types of information to copied to the clipboard.
    e.g. object type 1 - Document ID ( actual row's document ID from JTable ) - to copy document type
    object type 2 - string representation ( columns texts from JTable ) - to copy to excel
    I would like to keep them general, with different possible combinations
    among them ( up to 10 different object types ), according to some specs.
    Has anybody idea, if it is possible ? ( prefarably with 1.4 D&D interface ).
    Data are packed in createTransferable() call, but it allows just 1 format (?) ...
    Maybe I can use some 'envelope' format holding all possible information,
    but that idea doesn't looks nice for me :(
    Thanks for any hint.
    Tibor

    Hi !
    Thanks for your help. For drag & drop it's fine. System will ask for 'best' format as I expect.
    How is it with clipboard ? I had idea to copy table columns as a "text" flavor
    ( for paste into excel ) and user created flavor "id" with documentId inside.
    On paste I would take 'what's better' ( e.g. as a document reference better would be better my "id" flavor,
    because that information doesn't need to be in table cells inside ).
    Maybe I will have to use 'own' clipboard for these reasons.
    Tibor

  • I have an itunes account.  However, I need to copy music onto a different iPod than my own.  How do I do that?  Do I need to create a separate iTunes account for that iPod?

    I have an itunes account.  However, I need to copy music onto a different iPod than my own.  How do I do that?  Do I need to create a separate iTunes account for that iPod?

    An account means an iTunes Store account which is an online service.  Do you mean that, or do you mean a library on a computer?
    iOS devices can only be synced to one iTunes library at a time.  You can sync that iPod to your account but it will wipe everything currently on it.
    iTunes: Syncing media content to iOS devices and iPod - http://support.apple.com/en-us/HT201253 - detailed example: https://discussions.apple.com/message/18860187#18860187
    If you use manual syncing, you can sync items from more than one iTunes library to your iPod. (You can sync iPod touch, iPhone, and iPad with only one iTunes library.) When manually managing content, you can add content from multiple libraries to your iPod or iPad. Even when manually managing music, some content may be available from only one library at time. This includes all content on iPhone and video content on iPod and iPad. http://support.apple.com/kb/PH12113  and http://support.apple.com/kb/HT1202
    I could post another 2 pages of stuff trying to cover every possible scenario.  It would help if you let us know exactly what you want to do.  Are you trying to sync just a few songs (like giving them to a friend which is something iTunes is deliberately set up not to do)?

  • I had to reinstall ox and snow leopard on my imac g5.   I used the migration assistant on my macbookpro to copy everything onto the imac. The apps came in fine, but all folders say "no access." None of my user names seem to work. What now?

    My iMac G5 was running too slow. I tried everything I could think of or find in the literature, but finally had to start over by reinstalling OX and then Snow Leopard. I lost all my folders and applications, so I used the Migration Assistant on my MacBookPro to copy everything onto the iMac G5. The applications all came through fine, but all of my folders have the "no access" icon on them. I followed the instructions I found on line, but none of my user names worked. What do I do now? Am I just out of luck? The only other alternative I can see is to transfer all my folders onto a thumb drive and put them into the iMac, but that will be slow and cumbersome.

    Are you now using a different username from the one you used prior to migrating? If so that is the reason for the problem. You might, then, give this a try:
    To fix Home folder permissions
    Open the Terminal application in the Utilities folder.  At the command line prompt enter or paste the following command line:
    sudo chown -R `id -un`:`id -gn` ~
    Press RETURN.  You will be prompted to enter your admin password which will not be echoed.

  • How do i get my songs and data from my old mac onto my pc so that i can copy it onto my new ipod touch

    how do i get my songs and data from my old mac onto my pc so that i can copy it onto my new ipod touch

    jrswish wrote:
    When I plugged in my new one it cleared all my song and apps out of my current itunes.
    Are you sure of that?  Check in the Library.  Click on the Apps icon to see all apps.  Similarly click on the Music icon to see the songs.

  • CIC - Copy to the clipboard

    Hello,
    When user, on transaction CIC (l-shape), click on the ISU-Finder to find a BP by giving a premise number it should copy to the clipboard the BP when i click on the checkmark button. This part is build by SAP.
    I am trying to copy the Premise to the clipboard by using user-exit EXIT_SAPLEECIC_COMP00_001. I tried many attempts by using SAP function modules in order to create a Business Object Premise and add the element to the clipboard.
    I tried FMs such as :
    CALL FUNCTION 'CIC_EVENT_RAISE'
         EXPORTING
              event  = 'ADD_XTAINER_TO_BDD'
              p1     = xtain
         EXCEPTIONS
              OTHERS = 99.
    When i used this one, i got an item in the clipboard but it said : Uninitiliazed Business Process Unit.
    Does somebody have to code a 'Copy to Clipboard' for a businness object.
    Thanks

    I found byselft the solution. Here the step for those who have to do the same:
    Copy Premise to the clipboard (BDD)
      l_procobj-header = 'OBJH'.
      l_procobj-type   = 'SWO'.
    Create object Premises
      CALL FUNCTION 'SWO_CREATE'
           EXPORTING
                objtype = 'PREMISES'
                objkey  = l_key
           IMPORTING
                object  = l_procobj-handle
                return  = l_return.
      IF NOT l_return IS INITIAL.
        EXIT.
      ENDIF.
    Set Object ID
      CALL FUNCTION 'SWO_OBJECT_ID_SET'
           EXPORTING
                object    = l_procobj-handle
                objectkey = l_key
           IMPORTING
                return    = l_return
           EXCEPTIONS
                OTHERS    = 1.
      IF NOT l_return IS INITIAL.
        EXIT.
      ENDIF.
    Buffer Refresh
      CALL FUNCTION 'SWO_OBJECT_REFRESH'
           EXPORTING
                object       = l_procobj
           EXCEPTIONS
                error_create = 02.
      l_def-element      = '<MAINOBJ>'.
      l_def-editorder    = 2000 - 1.
      l_def-reftype      = 'O'.
      l_def-refobjtype   = 'PREMISES'.
    APPEND l_def TO li_def.
      CALL FUNCTION 'EWO_XTAINER_ELEMENT_SET'
           EXPORTING
                x_elemdef       = l_def
                x_value         = l_procobj
           CHANGING
                xy_xtainer      = l_desk_xtain
           EXCEPTIONS
                invalid_elemdef = 1
                internal_error  = 2
                OTHERS          = 3.
      CALL FUNCTION 'CIC_EVENT_RAISE'
           EXPORTING
                event  = 'ADD_XTAINER_TO_BDD'
                p1     = l_desk_xtain
           EXCEPTIONS
                OTHERS = 99.

  • E71 - Copy text to clipboard from from html reader...

    I could not copy text to clipboard from
    - Web page, html readers,
    - Web feed reader
    - Email reader. (if I choose reply or forward, then I can copy text)
    How to do it?
    is almighty E71 unable to do it?

    U can not even copy link on html reader or
    email address from email reader.
    How can Nokia make such a mistake?
    I think the Nokia programmers are aliens from other planet!!!

Maybe you are looking for

  • ICal crashes during launch

    Hello, I am playing around with an iBook G4 which has been not in use for some time. It has OS X 10.4.11 and iCal 2.0.6 installed. After launching iCal there are counting up figures in the dock on the iCal.icon. I heard these are events sent by other

  • How do I copy an image in LR to the clipboard?

    I can't find the option to copy an image from LR's library to the clipboard - I'm sure I'm just overlooking it - can someone help? Thanks!!

  • New MacBook Air I5 camera not working because of flash?

    I bought a new macbook air I5 13" last night at best buy.  This is not my first macbook.  However, I can't get the built in camera isight / facetime to work with web based sites.  I've logged in and out of different profiles.  Installed/Uninstalled f

  • Site doesn't get updated

    I've created a site with iWeb, embedded a song and clicked on the Publish button. The site was published, but I forgot to make the song loop. So I went to iWeb and checked the loop box in the Inspector (quicktime tab). I saved the change and hit Publ

  • IPhone 3G and Push Email Notifications

    Hello everyone. Before I got my iphone, I used to own a blackberry, and push email was my main form of communication on it. I cannot begin to describe how amazing push email was on the blackberry - the moment an email was sent to my address my blackb