Help using Clipboard needed, please!

Hi I would really appreciate a little help with the implementation of the Clipboard class in my applet/application.
I am designing a small program, I will run through quickly how and what this project does. The program is designed to check text given by the user to make sure that it doesn't contain material already held in a separate protected text file. For example I have a text file on my computer I would open this file, select all, copy & paste this into my program. Then I would press an 'OK' button in the GUI, the program would then check whether any of the text given by the user was already in a separate text file which belongs to the program.
So basically the program reads the user text comparing each line to the text file kept with the program. If the users text is the same as the external text file, the program would alert the user of this problem.
I hope that made sense, so getting to the point about the Clipboard class. The text that the user is to input into the program would be considerable in size so it wouldn't be feasable to expect them to enter it by hand. It would be far more suitable for them to be able to use the Clipboard fascility so they could copy and paste into them program. If any of you have any examples of this class being used I would be really interested in seeing your work and adapt some of it to my own creation. Any other advice in the design or whatever would also well appreciated. I am keen to do all the hard work I'm just a little confused by the Clipboard class and would like a little guidance.
Hope to hear something soon, Dave.

First off, the Clipboard class is in
java.awt.datatransfer, along with some other necessary
classes and interfaces. Here's a quick'n'dirty way to
get the contents:
String contents =
Toolkit.getDefaultToolkit().getSystemClipboard().getCon
ents().getTransferData(DataFlavor.stringFlavor).toStrin
();It's a little messy, but break it down and it works
quite easily. It would be nice to just have one
static method that would do it all for you, but that
might violate some programming style conventions.
-Tim
P.S. Just kidding, hambonethx this could be usefull :)

Similar Messages

  • I am using InDesign CS5. I have a body of text which is ranged left with tabbed indents. My client now wants the copy to be justifed, keeping the tabbed indents. Help and advice needed please!

    I am using InDesign CS5. I have a body of text which is ranged left with tabbed indents. My client now wants the copy to be justifed, keeping the tabbed indents. Help and advice needed please!

    Hi
    That screen grab helps a lot. There’s a much easier way of doing what you’re doing.
    Remove all your tabs and set the text in justified paragraphs.
    I’ve typed in dummy text in the example I made below, but after “19.1” put in a space and put your blinking cursor after the space and before the ’N’ of ‘Notices'.
    Then hold down the Command key and hit Backspace (on Mac at least - it’s the key between the Inverted commas/ apostrophe key and the return key).
    The text will jump into place the way you want it to.
    Hope that helps
    Paul
    PS You can set a tab, instead of using a space, in the description I gave above. So, after 19.1 or 19.2 or 19.185 etc etc insert a tab, then hit the Command Backspace after every paragraph number and they'll all line up exactly together. You'll find that editing text within the paragraphs
    after you've set it will be LOADS easier this way.
    You can put the tab anywhere you want it to be using 'Command-ShiftT' and putting a 'left align' tab just after the number. Just type the Command Backspace after the paragraph number and it'll work

  • Graphics help (I think) needed, please...

    Dear Experts,
    Please help. I don’t know where to turn.
    I recently bought myself a spanking new MacPro (Intel) and it’s lovely. I gave my old PowerMac G4 (Gigabit Ethernet/AGP Graphics) to my daughter who is about to depart to University and study Art, Media & Creative Writing.
    The PowerMac G4 has been upgraded with a Sonnet Encore ST/G4 processor, an ATI Radeon 9200 PCI Graphics Card and 1.2GB of RAM. It’s also had a PCI SATA Card installed so that two hefty internal drives can be fitted – and they both work a treat!
    I bought Final Cut Express for her since she’ll be making films and doing animation… but… the application itself was dimmed on the Installer disk because, I’m assuming, the ATI Graphics PCI card does not support Quartz Extreme (which FCE says it needs.)
    I instantly did my research and settled on the ATI Radeon 9600 Pro (Win/Mac) AGP Bus card thinking that it would do the trick… but the gold connectors at the bottom of the new card have absolutely no way of fitting into the AGP Bus slot on the G4 when I remove the originally installed ATI Rage 128 Pro AGP Graphics card.
    Now I’m stuck.
    I’m very wary of doing any more research of my own since the card I thought would work has turned out to be a disaster. Can anyone tell me what I need and/or what to do to make this whole thing work. Is there an AGP Quartz Extreme compatible Graphics card I can use… or is there an older version of FCE that will be suitable with the current ATI 9200 PCI card? Everywhere I go I find conflicting and bewildering advice so some help from some real experts would be truly terrific.
    I thank you (in advance) for any help you can offer.
    Danny
    PowerMac G4 (AGP Graphics)   Mac OS X (10.4.10)  

    Wonderful replies. Cheered me up when I returned (twenty minutes ago) from an arduous trip to Copenhagen. Even the Danish pastries couldn't do that!
    The answer is, "yes" - it will install quite happily on the Mac Pro and I don;t get any "Uh-oh, where's the Quartz Extreme I'm looking for?" messages - and that's what led me to deduce that it was all graphics-card related. I'm very willing to believe I'm wrong, but I'm no expert, and I don't know what I should try next.
    In the meantime, I'll just creep off into a corner and carry on laughing at the banter on this page!
    Thanks for your help, guys.
    Danny

  • Help with Launchpad Needed please.

    Please can some one tell how to stop getting all these updates in my Launchpad, I downloaded some code which got rid of the icons,(Happy) I started to organise them all,  then Microsoft update put 20 icons on it, and they cannot be trashed. Hate This! Its a waist of time using the code to delete if everytime there is an update on something or other, loads of icons appear. Why can I not have control over my own Mac!

    I think Ive worked out my own problem...
    After I attach the model to the parent with addChild, i then
    set its transform to transform(). ie.
    theChildModel.transform = transform()
    Which solves the problem of the child being offset from the
    parent.
    (below is a seperate problem, I'm using a sphere primitive,
    so theres no issue with possibly the sphere having an popsitional
    offset when i attach it as a child. My previous question was in
    relation to when I attach the actual head object, which did have an
    offset)
    But Now, I have a problem with the parent being positioned
    incorrectly when I try to use boneplayer to animate it.
    I tried to get down to basics, to work out where the position
    was first going wrong, and its when i add the bonesPlayer modifier.
    These are the simple steps I take...
    I copy the Torso model into the 3D world. (this has a bone
    structure and a dummy Model in the correct position for head,
    hands, feet)
    Then I create a sphere primitive.
    Then I add the sphere as a child of the Torso's child[1]
    dummy Model, which I know is the 'head's dummy Model.
    That works fine, the sphere is in the correct 'head'
    position.
    But then when I add the bonesPlayer modifier to the Torso
    Model, the sphere jumps to an incorrect position(about in the
    middle of the torso model).
    Anyone experienced something like this before? Should I be
    doing something first before I add the bonesPlayer modifier?
    I have a very trimmed down demo of what Im talking about, if
    anyone would like to see the code.
    Any help greatly appreciated.
    Glen

  • Help desperately really needed please

    Im using front page and im trying to put a macromedia flash player into my webpage so when people click on it it will give them the allow or deny box for their webcam how can i do this? html code i cant seem to find only for movies nothing to enable webcam
    anyone able to help me PLEASE

    Welcome to Apple Discussions!
    So the songs are not on your computer?
    Either way, to start off, make sure everything is up to date...
    iTunes
    iPod Updater
    Updating iPod's Software
    btabz

  • Help and advice needed please

    Hi all, had a moving home 12 days ago, my ip profile is 56.56 but I only get a average of 25mb throughput on Ethernet. I also wanted a data extension but the subby made a right mess of my wall and the data ext kills my bb when connected, so I have had to completely remove it and buy a long white Ethernet lead. Any advice please guys? Ps my bras is 58mbps
    Thanks

    The subcontractor left the bt socket off the wall, holes in my fresh painted skirting board as he didn't want to get his drill so tried to mount on the skirting, also tried to mount the modem on skirting! . He said do I want to mount it all!? I said yes due to the mess he was making of my new house. I'm field staff for a rival company so the mounting was no problem. But what he did do was use telco wire from x2 terminals from the I plate I think it's called to data socket. When ethernet plugged into socket my bb drops? Hence I had to take it away. When he left I was getting approx 40 meg throughput, this has dropped to 25 ish since. My brass rate is still 56.56 dropped from 58mbps. I have made good his damage so won't raise a claim. But if anyone could offer advice, that would be great. I would also like to communicate with a moderator if poss? Thanks

  • Help with Divs need please

    Hello could someone possibly help me.
    My page layout has a top banner ("banner"), then main content
    below in the middle (middletext), and a fotter ("footer") below the
    "middletext" div
    I want place a div of say 100px directly to the right of the
    "middletext" div. The layout is fluid so I want the right div to
    move with the rest of the page when resized in an IE window. Here
    is the code for the css -
    body {
    background-color: #666666;
    background-repeat: repeat-x;
    #background {
    background-color: #999999;
    background-repeat: repeat-x;
    width: 80%;
    #content {
    background-color: #CCCCCC;
    background-repeat: repeat-x;
    height: 300px;
    #middletext {
    background-color: #FFFFFF;
    background-repeat: repeat-x;
    margin-left: 200px;
    margin-right: 200px;
    height: 300px;
    #footer {
    background-color: #9999FF;
    background-repeat: repeat-x;
    height: 100px;
    #rightcontent {
    background-repeat: repeat-x;
    width: 100px;
    background-color: #CCCC66;
    height: 100px;
    position: absolute;
    left: 1052px;
    top: 135px;
    #banner {
    background-color: #996633;
    background-repeat: repeat-x;
    height: 100px;
    And the code for the html page -
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <link href="test.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) { //reloads the window if Nav4
    resized
    if (init==true) with (navigator) {if
    ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
    onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW ||
    innerHeight!=document.MM_pgH) location.reload();
    MM_reloadPage(true);
    //-->
    </script>
    </head>
    <body>
    <div id="background">
    <div id="banner">Content for id "banner" Goes
    Here</div>
    Content for id "background" Goes Here
    <div id="content">
    <div id="middletext">Content for id "middletext" Goes
    Here</div>
    id content </div>
    <div id="footer">Content for id "footer" Goes
    Here</div>
    </div>
    </body>
    </html>
    I also have the width of the page set to 80%, just to give a
    small border, but how can I center the entire page?
    Many thanks in advance!!
    Billy.

    Add the 'right' <div> before the 'middletext'
    <div> and float it right
    with a width of 100px. See code and css below.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <link href="test.css" rel="stylesheet"
    type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) { //reloads the window if Nav4
    resized
    if (init==true) with (navigator) {if
    ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
    onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW ||
    innerHeight!=document.MM_pgH)
    location.reload();
    MM_reloadPage(true);
    //-->
    </script>
    <style>
    body {
    background-color: #666666;
    background-repeat: repeat-x;
    #background {
    background-color: #999999;
    background-repeat: repeat-x;
    width: 80%;
    #content {
    background-color: #CCCCCC;
    background-repeat: repeat-x;
    height: 300px;
    #middletext {
    background-color: #FFFFFF;
    background-repeat: repeat-x;
    margin-left: 200px;
    margin-right: 200px;
    height: 300px;
    #footer {
    background-color: #9999FF;
    background-repeat: repeat-x;
    height: 100px;
    #rightcontent {
    background-repeat: repeat-x;
    width: 100px;
    background-color: #CCCC66;
    height: 100px;
    position: absolute;
    left: 1052px;
    top: 135px;
    #banner {
    background-color: #996633;
    background-repeat: repeat-x;
    height: 100px;
    #right {
    float: right;
    width: 100px;
    background-color:#FFFFFF;
    </style>
    </head>
    <body>
    <div id="background">
    <div id="banner">Content for id "banner" Goes
    Here</div>
    Content for id "background" Goes Here
    <div id="content">
    <div id="right">right</div>
    <div id="middletext">Content for id "middletext" Goes
    Here</div>
    <div id="footer">Content for id "footer" Goes
    Here</div>
    </div>
    </div>
    </body>
    </html>

  • Rebuilding Credit- Help and Advice needed please

    Hello, i'm currently working on rebuilding my credit. There are 2 charge offs and 2 collections ( for those charge offs) on all three credit reports. I would love some adivce on the best course of action. I am in MA and the SOL is 6 years. Thank you! I do have positive TL's, the ones posted below are the only negative items on my report. I also have paper copies of my report just not with me right now. MyFico scores (FICO8) are currently EQ: 654 TU: 643 and EX: 648 This is what it looks like on Experian:Account 1:Account nameCOMENITY BANK/EXPRESSAccount numberXXXXXXRecent balanceNot reportedDate opened12/2006StatusClosed.   PO BOX 182789COLUMBUS, OH 43218No phone number availableAddress identification number0000621071TypeCharge CardTermsNACredit limit or original amountNot reportedHigh balance$1,667Monthly payment$0Recent payment amountNot reportedDate of status02/2015First reported01/2013ResponsibilityIndividualCommentPurchased by another lender. Account 2:Account nameCOMENITY BANK/VCTRSSECAccount numberXXXXXXRecent balanceNot reportedDate opened04/2007StatusClosed. $1,171 written off.O BOX 182789COLUMBUS, OH 43218No phone number availableAddress identification number0788274468TypeCharge CardTermsNACredit limit or original amount$370High balance$1,171Monthly payment$0Recent payment amountNot reportedDate of status02/2015First reported04/2007ResponsibilityIndividualCommentPurchased by another lender. COLLECTION 1Account namePORTFOLIO RECOVERY ASSOCIATESAccount numberXXXXXXXRecent balance$1,668 as of 07/08/2015Date opened02/2014StatusCollection account. $1,668 past due as of Jul 2015.20 CORPORATE BLVD STE 100NORFOLK, VA 23502800 772 1413Address identification number0000621071 Original creditorWORLD FINANCIAL NETWORK BANKTypeDebt BuyerTerms1 Months On record untilMay 2019Credit limit or original amount$1,668High balance$0Monthly payment$0Recent payment amount$0Date of status05/2014First reported05/2014ResponsibilityIndividual  COLLECTION 2Account namePORTFOLIO RECOVERY ASSOCIATESAccount numberXXXXXXRecent balance$1,172 as of 07/08/2015Date opened08/2014StatusCollection account. $1,172 past due as of Jul 2015. 120 CORPORATE BLVD STE 100NORFOLK, VA 23502800 772 1413Address identification number0000621071 Original creditorWORLD FINANCIAL NETWORK BANKTypeDebt BuyerTerms1 Months On record untilAug 2019Credit limit or original amount$1,172High balance$0Monthly payment$0Recent payment amount$0Date of status11/2014First reported11/2014ResponsibilityIndividual  Also under the potentially negative items section is a capital one credit card that I had that was closed and I paid off and this is what it shows:Account nameCAPITAL ONE BANK USA NAAccount numberXXXXXXXXXXXXRecent balance$0 as of 07/17/2015Date opened02/2005StatusOpen.  PO BOX 30281SALT LAKE CITY, UT 84130800 955 7070Address identification number0000220565TypeCredit cardTermsNACredit limit or original amount$1,500High balance$1,702Monthly payment$8Recent payment amount$0Date of status02/2013First reported02/2005ResponsibilityIndividual 

    The subcontractor left the bt socket off the wall, holes in my fresh painted skirting board as he didn't want to get his drill so tried to mount on the skirting, also tried to mount the modem on skirting! . He said do I want to mount it all!? I said yes due to the mess he was making of my new house. I'm field staff for a rival company so the mounting was no problem. But what he did do was use telco wire from x2 terminals from the I plate I think it's called to data socket. When ethernet plugged into socket my bb drops? Hence I had to take it away. When he left I was getting approx 40 meg throughput, this has dropped to 25 ish since. My brass rate is still 56.56 dropped from 58mbps. I have made good his damage so won't raise a claim. But if anyone could offer advice, that would be great. I would also like to communicate with a moderator if poss? Thanks

  • Verizon app help on LGG2 needed,please

    How do I disable the Verizon security app, seems to slow down everything.
    I removed the Verizon app icon which shows data useage and data limits accidently . How can I get it back?

    Hi.Press Settings-scroll down to Application manager-swipe left twice to have ALL apps displayed and scroll down to Verizon Support & Protection.From here you can disable it and force stop it.
    To show again Data usage go to your widgets and add it manually. Hope it helps

  • Help on TC needed please

    Hi all,
    I recently got a TC to replace my speed touch dsl modem/router as I thought the TC is much better. Unfortunately to my surprise, the wifi signal of the TC seems to be less powerful + Internet is more slow. I wonder if I have some settings that are not quite correct. I wrecked my brain over the net looking for settings and everything seems correct. Any ideas on this issue?
    Anyway, I am now considering either an airport extreme or airport express to extend the coverage. My questions are:
    1. Is the wifi signal of airport extreme, airport express and time capsule the same or one is more powerful than others?
    2. I'm thinking of getting an airport extreme to be the main wifi hub (ie the adsl modem would be connected to it) and putnthe TC downstairs to extend the signal. With this in mind I would connect it to a western digital tv live and stream videos.
    3. If i connect an airport express to my western digital will i be able to stream video files stored on my TC or it will be slow?
    Any feedback would be appreciated. Thanks.
    Kind regards
    Aldo

    Hi.Press Settings-scroll down to Application manager-swipe left twice to have ALL apps displayed and scroll down to Verizon Support & Protection.From here you can disable it and force stop it.
    To show again Data usage go to your widgets and add it manually. Hope it helps

  • Help needed please.. how do I remove my credit card from itunes? just discovered over $450 of charges when I looked at my email... Kids had no clue they were using our money and not their gift cards

    Help needed please.... I just discovered over $450 charges to my credit card from Itunes. The kids had no idea they were using our credit card and not their itunes gift cards and 4 year old just clicks on anything! I didnt save my credit card details so am a bit miffed at this... I cant find anywhere in itunes to remove it. Edit.. but not remove. Editing does not remove it.. HELP

    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact
    Accepted forms of payment  >  http://support.apple.com/kb/HT5552
    Changing Account Information  >  http://support.apple.com/kb/HT1918

  • Hello, Our indesign file keeps crashing and we need to go to print today. We use CS6. Please help!

    Hello, Our indesign file keeps crashing and we need to go to print today. We use CS6. Please help!

    Ok - we're going to need a few more details.
    Operating System - Windows or Mac?
    Version of CS6 - are you fully patched to the latest version (Help>Updates)?
    Do you use any 3rd Party Plugins (Help>Manage Extensions and look for 3rd Party Plugins)
    At what point does it crash? How are you exorting/printing?
    What file type or action are you doing when it's crashing?
    Common Troubleshooting tips
    Troubleshooting 101: Replace, or "trash" your InDesign preferences
    https://forums.adobe.com/thread/526991
    File Crashing on Output - printing/PDF/other

  • Uloading ebook using iProducer rec'd error: ERROR ITMS-9000: "Unable to parse nav file: toc.ncx" at Book. I don't understand and need help fixing it. Please Help

    Uloading ebook using iProducer rec'd error: ERROR ITMS-9000: "Unable to parse nav file: toc.ncx" at Book. I don't understand and need help fixing it. Please Help if you've the knowledge.
    Many Thanks

    Yep, i just did it again. The entire scroll-bar widget, complete with formatted text, graphics, etc., pasted itself nicely in another book. Two different files, the same widget.
    I use the scroll-bar widgets for most of my texts. (I have audio buttons on the side, and the scripts are within the widget, to the side). My only text is within widgets, and text boxes, naturally. 
    I am following your recommendation: cleaning files, etc. I am remaking the book anew. I need to convince the EPUB bot or whatever that my file looks and works nicely on all my devices. You would expect an error message when previewing the book: 'Hey Amigo, your file is flawed, stop working on it, and get back to the drawing board." Should be able to try again next Monday.

  • Help me i cant install itunes on my windows 7 enterprise i try installing 32bit and it says that i need the 64bit but then in need the 32bit to use the 64bit please help!!!!

    help me i cant install itunes on my windows 7 enterprise i try installing 32bit and it says that i need the 64bit but then in need the 32bit to use the 64bit please help

    Hi there,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    Trouble installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    -Griff W.

  • HT201328 my iphone 4G buy from japan, i need to use in indonesian, please help me, i spent much money for this phone.....

    my iphone 4G buy from japan, i need to use in indonesian, please help me, i spent much money for this phone.....

    froggy_vic wrote:
    so even if your phone is unlocked you wouldn't be able to use it anywhere else.
    Absolutely not true. There is no difference, spec wise, between the iPhone sold in Japan & the GSM iPhone sold everywhere else. iPhones in Japan use UMTS 2100.

Maybe you are looking for

  • BPM is in Process (Not completed after 3 days also)

    Dear All, I have an existing scenario, which was working fine. The scenario is File to IDoc, wherein picking up a file and splitting into multiple IDocs. The BPM is working out; able to send IDocs but not all the ones. The bpm is still in process it

  • Stored Procedure Call with only Input Parameter

    Hi, The Example at Oracle Toplink Developer's Guide, Volume 5 uses an output param named IS_VALID. How Can I Call a Stored Procedure that has only Input Param ? If I don't use an Ouput Param Toplink throw the following Exception: *Excepción [TOPLINK-

  • User wise change of sensitive fields

    Hi guys, We are having trouble with fields like payment term, payment block and baseline date. All user can change them as and when they want. Is there any possiblity of restricting of the change of these fields to users. I mean here,some users shoul

  • Why do we use init() method instead of constructor to initialize a servlet?

    Why do we use init() method instead of constructor to initialize a servlet?

  • "Do Not Disturb" Malfunction in iOS 6 on 3GS

    Do Not Disturb was enabled, scheduled and on. Only Favorites were allowed to get through. But, I just received an incoming call from a telephone number that's *not* in my Favorites, but which *is* from a Contact. So, what feature that should have bee