Using the Clipboard

Hi all
Ive noticed the clipboard features in java but from some of the examples ive been seeing it doesnt seem to be that versatile
examples ive seen are such things like copy text from one text box to another using the clipboard but it only does this by doing a getText() on the textbox and putting that in the clipboard then doing a setText() on the other textbox from the clipboard
but what i want to be able to do is any selected text when copy is clicked, it is added to the clip board (whether the selectted text is in a text box or in a textpane) then paste that text to where ever the cursor is (be it in a text box or cursor)
is there a simple way of doing this or do i have to basically capture every focus event on the text boxes and textpane and then let the clipboard know i am copying and pasting from the currently focused field?

Swing related questions should be posted in the Swing forum.
All text components support the standard KeyStrokes:
Ctrl-C, Ctrl-X, Ctrl-V
You can also add menu items or toolbar buttons to perfrom these Actions. See the Swing tutorial on "Text Component Features":
http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html

Similar Messages

  • Copy/paste without using the clipboard?

    Can this be done without using the clipboard?
    myTable.select()
    app.copy()
    app.select(myCopyFrame.insertionPoints.item(0));
    app.paste();

    Can you please not use that site, or (if you must) at the very least not refer to it in this forum?
    Its entire contents is "stolen" -- the guy who made it advertises himself as "proficient XML and HTML programmer", but rather than proving it by doing something worthwhile himself, he copied the entire contents of the heavily improved HTML version I made from Adobe's own documentation. To add insult to injury he wrapped it up in heavily advertised pages.
    The help text is Adobe's own, but I vastly improved upon it by adding yet even more hyperlinks, categories, and a graphic hierarchical view. An even better version than the one this ****head stole can be downloaded for free (and without any advertisements) from http://www.jongware.com/idjshelp.html. I made it better just to prove I could; so far this stinking thief didn't dare copy the latest version -- yet.

  • Accessing and using the Clipboard

    It is very seldom that I need to use the Clipboard, so I never can remember how to accesss it on the rare occasions that it is useful.  I FINALLY found it today, but I don't want to have to go through this again, Therefore, I have two qustions:
    (1) Is there a way to put it in FAVORITES? If so, how?
    (2) There is now a link in my Clipboard that I want to send as an E-mail attachment. Unfortunately, I can't copy it. How to I remove/copy something on my Clipboard?

    It is very seldom that I need to use the Clipboard, so I never can remember how to accesss it on the rare occasions that it is useful.  I FINALLY found it today, but I don't want to have to go through this again, Therefore, I have two qustions:
    (1) Is there a way to put it in FAVORITES? If so, how?
    (2) There is now a link in my Clipboard that I want to send as an E-mail attachment. Unfortunately, I can't copy it. How to I remove/copy something on my Clipboard?

  • InDesign crashes when I use the clipboard too much

    Wow, this site is truly terrible.
    Anyway.
    I am experiencing a crash in InDesign when I use the clipboard too much.
    I have a habit of hitting "Ctrl + C" more than once, and this appears to trigger a race condition that causes a crash.
    It's reproducable but doesn't happen every time.

    TomMettam wrote:
    Wow, this site is truly terrible.
    What's that supposed to mean?
    Are you saying you hit Ctrl-C more than once without changing the selection? I don't tend to do that, so I don't know if it's a problem, but I've NEVER had that error using the clipboard in ID. What version of Windows are you running? You seem to have ID CC (dark interface is a clue), but is it 32- or 64-bit?

  • 10.3 Apps crash whenever trying to use the clipboard

    Hello all,
    My girlfriend recently got a B+W G3 350. We spent some time with it and have 10.3.3 up and running quite nicely.
    There is only one small problem: whenever you try and copy or paste text in any application (we've tried Safari, FireFox, TextEdit) the application crashes with an "Unexpectedly Quit" error.
    The only exception to this is AppleWorks 6; the clipboard works without a hitch in that app.
    After having lots of "Unexpectedly Quit" messages with my G4 MDD, I decided I would try memtest on the G3 and make sure there wasn't anything going on there (as had been the problem with my G4).
    I ran it on all RAM, 5 passes. Passed.
    Any help would be greatly appreciated. She can still work in AppleWorks for her schoolwork, so it's really more of a nuisance than anything, but I'd like to have it resolved. If possible, I'd like to not update it to 10.3.9, as I did have it running for a time on a similar machine and it was much slower than 10.3.3.
    I have also Safe booted; same problem there. And I tried rm'ing /Library/Preferences/com.apple.finder.plist, to no avail.
    Once again, thanks for any help.
    Chris Graham
    B+W G3 350   Mac OS X (10.4.9)   256MB RAM, 12GB HDD, Rage 128

    You're Again Welcome Chris!
    "...and the disks that came with the laptop."
    AHA! That's one problem! You must use the Full Retail Version, of the Panther Install CDs.
    Additional info in these links.
    Using OS X Install CDs/DVDs On Multiple Macs
    What's A Computer Specific Mac OS X Release
    Software Update, Upgrade: What's The Difference?
    "...I did not install the SCSI card firmware update,..."
    That's another problem. The Firmware Update must be installed.
    You must start the computer from a Mac OS 8 or Mac OS 9 System Folder on the computer's hard disk, not from a CD, in order to install it.
    And that creates yet another problem, as you do not have the original system discs.
    Where did you acquire the Mac? Is there any way of contacting the previous owner to request them?
    Panther, is no longer available directly from the Apple Online Store, as Tiger 10.4.x is the most up to date OS.
    If you know what to look for, a Full Retail Version, of the Panther Install CDs, can be purchased rather inexpensively, at some online Apple retailers, Amazon, eBay, AppleRescue, FastMac, etc.
    Be sure not to purchase grey, upgrade or machine specific CDs or DVDs.
    Panther is only on CDs, not DVDs.
    Unless purchased from AppleRescue, the discs should look exactly like the images in the above links, and not say Upgrade on them.
    Once Panther 10.3.x is installed, you can use the 10.3.9 Combo Update, to upgrade to the final version.
    Panther System Requirements
    Additional Panther System Requirements
    Shop Carefully, Examine All Documentation, And Good Luck!
    ali b

  • How to transfer data using the clipboard

    Does anyone know how to transfer data (string) from the clipboard to labview?
    I am trying to write C++ code using win32 API using the calls, OpenClipboard, Getclipboard and CloseClipboard functions. The problem is LV crashes when there is a call to the library function. Perhaps I am going about this the wrong way.
    Any ideas are appreciated.

    Perhaps this approach will give you the answer. I wrote a VI that uses the Win32 API directly. It calls OpenClipboard with the calling VI's window handle, then calls GetClipboard with the GW_TEXT constant to get a memory block handle. I lock the memory block with GlobalLock so other applications can't mess with it. I next call lstrcopynA , initializing a arg1 as a C String with 256 bytes and using the memory block handle as arg2, with the length of arg1 minus one as arg3. Your clipboard text is in the string output. Now call GlobalUnlock and CloseClipboard and you're done!
    Attachments:
    getclipboarddata.llb ‏168 KB

  • How to use the Clipboard with certain sites

    I use the copy and paste function from the clipboard frequently to allow access to certain pages. It worked fine until I updated Firefox to latest 29.0 version. It no longer works! I followed the usual instructions to create a user.js file and put it in the profile directory. But the problem is still there. Need help with this problem.

    Hello,
    Sorry for taking so long in responding. Here is the screenshot. Hope that helps to find a solution.

  • I am using a web hosted email site and I am unable to use the clipboard/cut/paste functions? I already tried to create a user.js file with script but its still not working. What else can I do?

    I have double, triple checked to script and I can't find any errors.
    The only thing I might be unsure of is the actual site that I am listing. I tried https://www.webmail.????.com and I tried https://www.????.com. Is it that its a secure site? HELP

    Did you try to use the keyboard instead (Cmd+V and Cmd+X and Cmd+C)?
    Maybe Shift + Insert works as well on Mac (does work on Windows and Linux).
    *http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard
    *https://addons.mozilla.org/firefox/addon/allowclipboard-helper/ - AllowClipboard Helper

  • Using the Clipboard to Copy Between Applications

    I'm trying to design a postcard online and the instructions say to make my image 350 dpi, 4"x 6", copy and paste it onto their format. I get a message saying it is too big for my clipboard. When I looked at my clipboard size, my 5.0 version says the script is for a 4" x 4" clipboard. So just to see if I could reduce my image to less than that and have it transfer, I still got the "too big" message. Any advice?

    too big for my clipboard
    I get this error from photoshop elements 2.0 and I think it is a bug in that software. My work around is to disable Export Clipboard in PE2 preferences, but that is irrelevant to your problem.
    This is a bit of a long shot but maybe this application could be the answer.
    Savvy clipboard.
    http://www.blitzclicksoft.com/products.php

  • I am trying to take a picture of a web page and paste on a one drive powerpoint. I tryed pressing the print screen button, and pasting. But it is giving me message saying that my browser can not fine the clipboard, and I need to use the keyboard shortcuts

    I need to take a picture of a web page, insert it onto a powerpoint online, and crop the picture. I am pressing the print screen button, and right cliking paste. But I am getting the warning message saying that my browser can not use the clipboard, and I am unsure of how to take a picture, then paste it, and crop it all on to a power point.

    http://portableapps.com/apps/internet/firefox_portable/localization#legacy36

  • Problem with the Clipboard after upgrade

    We had been using Intermedia, along with the Clipboard and WebAgent in Oracle 8.1.5. A few days ago we upgraded to 8.1.6 (I performed the Intermedia upgrade as well). Oracle is Installed on a Solaris 7 server.
    We installed everything into a new Oracle Home.
    The code we had written using the Intermedia procedures and packages still works but now the CLIPBOARD is not working. The ClipBoard and Web Agent are installed on an NT server running IIS
    Using the ClipBoard, when we we try to connect to the database we get the folliwng error:
    ORA-12564: TNS connect refused
    In the LISTENER.log on the server we see the following corresponding errors:
    26-APR-2000 09:18:16 * (CONNECT_DATA=(SID=cadv)(ORACLE_HOME=/u01/app/l1oradv/product/8.1.5)(SERVER=DEDICATED)(CID=(PROGRAM=C:\WINNT\System32\inetsrv\inetinfo.exe)(HOST=L10008016)(USER=IUSR_L10008016))) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.27.
    125.68)(PORT=1206)) * establish * cadv * 1201
    TNS-01201: Listener cannot find executable /u01/app/l1oradv/product/8.1.5/bin/oracle for SID cadv
    The /u01 directory is the OLD Oracle home. I cannot figure out where the Clipboard is pulling that name from. I went through the tnsnames.ora on the client and the server and both point to the new Oracle home. I also went through the LISTENER.ora and there are no reference to the old Oracle home. On the NT Server where the Clipboard and Web Agent are installed I went through the wsc.cfg and everything looks good. There is no reference to the old Oracle home. I also verified the old listener is not running on the Solaris server.
    Where could this be buried? Everything else (DBA Studio, SQL*Plus worksheet) is working from the same NT Server running the Clipboard. I cannot find where the old Oracle home reference is coming from.
    Marilee

    Hi,
    The Clipboard uses the Web Agent to connect
    to the database, so it should be possible to
    track this down just using the web agent.
    The web agent itself is just a regular OCI
    client application - it doesn't do anything
    special when it comes to connecting to the
    database, it just uses the SERVICE attribute
    in the WSC.CFG file as a SQL*Net TNS service
    name in TNSNAMES.ORA. The first thing to try
    is to test the database agent being used by
    the clipboard from a browser. Eg:
    [URL=http://host/intermedia/<dbagent-NAME>/~test]http://host/intermedia/<dbagent-NAME>/~test[/URL] That should result in the same error message
    being logged by the listener and should also
    result in an error message being displayed
    on the browser window.
    To verify that the Web Agent is reading the
    correct TNSNAMES.ORA, you can create another
    database agent and include the entire
    connection string as the service name instead
    of using a TNS service name. This is probably
    best done by editing WSC.CFG, creating a new
    database agent by copying the existing one
    and replacing the service name with the
    connect string from TNSNAMES.ORA, making sure
    the string is all on 1 line. For example:
    [database_agent.sample-test]
    service = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = mypc)(PORT = 1521)) )(CONNECT_DATA = (SERVICE_NAME = orcl) ) )
    database_user = scott
    database_password = tiger
    authorized_request_class = retrieve
    authorized_sql_statements = procedures
    authorized_sql_procedures = *You can also verify the connection string
    using SQL/Plus. For example:
    sqlplus scott/tiger@"(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = mypc)(PORT = 1521)) )(CONNECT_DATA = (SERVICE_NAME = orcl) ) )"If the connection string works but the TNS
    service name doesn't, then I suspect that the
    web agent is looking at an old TNSNAMES.ORA
    file. If so, its because an old file exists
    in the PATH being used by IIS. Another
    possible, though much less likely problem is
    that there's an old OCI DLL and/or Oracle
    home in the PATH used by IIS.
    Simon

  • Problem with InDesign, Photoshop and the clipboard...

    Dear community,
    this is my first posting within the adobe forums, please be gentle
    So, first things first. We recently switched from PowerPC PowerMac infrastructure to much more powerful Windows machines (i.e. i7 3.4GHz, 16GB Ram, 128GB SSD and decent Motherboards). Now one very annoying bug occurs (and it only occurs on windows machines).
    System Information
    - Windows 7 SP1 (x64, enterprise edition)
    - Creative Suite Design Standard
       - Indesign v7.5.1
       - Photoshop
    Lets assume we have an InDesign-Document with the following specifications:
    Around 8mb size
    Various Layers with images on network storages (mixed, eps and tif documents)
    one of it is a relatively large tiff file (178mb) (300dpi, about 9.200x12.000px, opens normally in photoshop)
    When I copy all elements of one page into the clipboard, it renders the pdf for a while. If I then try to start a new document in Photoshop, it won't let me use the clipboard, even though the document is in the clipboard (new document in indesign -> paste -> ét voila).
    It seems to be the fault of either the tiff or some text layers (the used font is okay and recognized by photoshop, no errors here), but since we need the whole document in PS for editing purposes, it's a no-brainer to exclude layers for copy&paste.
    What I've tried so far:
    it's not the system itself, the error occurs on every machine, no matter if real computer or just a virtual machine with only windows, indesign and photoshop
    Modified registry values for Photoshop (inserted AlwaysImportClipboard and AlwaysImportClipboard64 in HKEY_CURRENT_USER\Software\Adobe\Photoshop\55.0\) - no change here.
    empty clipboard in Photoshop before c&p.
    Stupid thing is ... it works flawlessly on Mac OS X 10.6.8 with the same Creative Suite version It would be great if anyone has any ideas concering this error.

    I have just that !

  • Labview freeze when accessing a custom menu with data on the clipboard

    This one has got me stumped:  When selecting a custom menu item with data on the clipboard the GUI freezes.  Freezes are longer for more data and longer for older versions of Labview.  I wrote the test code, attached, but the example "Menu Selection Demo.vi" shows the same behavior.
    Running Labview 2011 here are some freeze delays for my laptop (a bit slower machine) with various amounts of text data on the clipboard:
    Clipboard size        Delay
    1.3MB                   2.1 sec
    2.6MB                   4.9 sec
    3.8MB                   17.2 sec
    14MB                    253.3 sec
    The delay appears to be non-linear.  A doubling of the clipboard data size more than doubles the delay and a tripling of the clipboard data size produces a delay of almost 10X!  Things are also much, much worse on my ancient version 8.2.1 (over a 40 second freeze for 1.3MB and it goes up from there).
    Note that the freeze also occurs on programs with a custom menu when exiting.  This would seem to suggest it might have something to do with the timeout, but why timeout should vary with clipboard size and not with the value wired to it makes this feel even more like a bug in the custom menu functionality.
    This seems to be related to known issues in Labview 2011 #39604 49UBP4LE (http://www.ni.com/white-paper/13168/en#39604_by_Da​te) that was first reported in version 8.2.1.  This known issue relates to Labview freezing when large amounts of data are copied from Labview to the clipboard.  No fix has been implemented since this was originally reported in 2007.
    This freeze also occurs when shortcuts to menu items (such as Ctrl + L) are used when large amounts of data are on the clip board.
    Thus far this has been 100% repeatable and I have not been able to find a way around it.  I also haven't found anything else similar on the forums or on the web.  It appears to be a GUI freeze with Labview still running in the background, which is also odd.
    My work-arounds at this point are either to not use the clipboard (bad), programatically clear the clipboard several times each second (worse) or remove all custom menu functionality and replace those functions with onscreen controls.  So, for now, I'm removing custom menu items because my users need the clipboard and I can't have massive delays making my data acquisition code look crashed.
    Any ideas would be helpful.  This one has me scratching my head...
    Attachments:
    Menu_Clipboard_Lv2011.vi ‏17 KB

    Well, doing Microsoft Word, Excel and what else on a computer that is used to run an important production test, is a very bad idea. There is no way that you can guarantee, that one of these applications is not causing some interruption to the currently running time critical task. Word and Excel and just about any other computer application can crash, lock up the computer or eat your breakfast while you are doing seemingly harmless things.
    The issue with the clipboard in LabVIEW is indeed a problem that exists for a long time and I hope they fix it sometime, but the fact remains, that you should NEVER use a computer for other tasks while you run a test or other manufacturing related application on it, when a failure of that application can cost you more than a few pennies.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Using javascript to copy to the clipboard in Safari

    I had an application for taking notes in IE for the windows computers at my company. It used Javascript to copy the contents of a text box to the clipboard.
    Now that we've switched to macs (and love them), this no longer works in eitehr Safari, Firefox, or Camino for the mac.
    If there is a javascript command that will let you copy a text box's contents to the clipboard that works with any of these browsers, I'd be greateful for a few pointers int he right direction.
    Thanks in advance!

    jalperin wrote:
    > Here's what I'm doing:
    >
    Using a data set observer, check for
    onPostLoad and generate the html
    > code
    >
    Using innerHTML, stuff the code into
    the appropriate <div>
    >
    Use regionName.updateContent() to
    update the region I just created
    > with the html code I generated
    >
    > Interestingly, if I take the generated source for my
    page and remove the data
    > set observer, the Spry table displays correctly with all
    the expected values.
    > This suggests to me that my generated html code is
    correct, but that there is
    > some sort of timing issue (i.e. Spry doesn't know about
    the new code I
    > generated).
    >
    > Any suggestions?
    I'd guess that it is a timing issue as well. I haven't looked
    much at the dataset capability in Spry, but it may be that the
    dataset "finds" all of the regions and code that it applies to
    before the onPostLoad event is triggered. If that is the case, then
    your generated code doesn't exist yet,and so the dataset thinks
    that there is nothing for it to apply to.
    Will the HTML that you generate change based upon the dataset
    that is actually returned? I guess I'm looking for the reason why
    the HTML is being generated when it could be in the page itself and
    avoid this issue completely.
    Danilo Celic
    |
    http://blog.extensioneering.com/
    | WebAssist Extensioneer
    | Adobe Community Expert

  • 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

Maybe you are looking for

  • Is there a way to add two windows in the same window?

    is there a way to add two windows in the same window?

  • Is it possible to make an alert message.

    Hi, Anyone knows if it Is possible to make an alert-message that pops up ( f.e as a little window) on a specific day to remember me of something I have to do that day? Would be handy. Is this possible with Tiger or is there a third party application

  • How do I set up a shared server Oracle 9i

    I'm trying to switch from a dedicated server to a shared server. I added mts_dispatchers, mts_servers and mts_max_servers to my configuration file, but got a message saying they have been depricated. How is this done in 9i? Thanks for your time, Anth

  • LINE ITEM PROBLEM

    hi experts ! There is a Program for displaying domestic sales figures as per    customer/document type/profit centre wise.. input data for report is Company code DOCUMENT TYPE START DATE & END DATE FINANCIAL YEAR. problem is in date when i entered D3

  • Layout module master data sending to F&R system

    Hi Friends, When interface is sending layout module master data to F&R system, getting error message 'FRE_MD_LAYOUT_SEND PROCESSING DELTA E    Sending release profiles - System Failure:' in FRE_UI t code. When i am re-transmitting those backup files