Get Contents From Copy

When you copy something from a text editor on your computer(the System) what ever the editor may be(NotePad or WordPad or any IDE area the text is saved) and you want to paste it. How do I access that text or string so I can paste it into a Java application I am running.
I am guessing(not really a guess since I have experimented) the copy function for the system saves one copy of text at a time. I figure this text must be saved in a system variable somewhere, and I want to know how to access this text and implement it into my Java program so I can paste it into a JTextArea or a JTextField.
For example, I want to copy a string of text from NotePad using the System copy function and then paste it into my Java application(JTextArea or JTextField).
Once I have the inputted text saved in a String variable I can paste it at will but the problem is I do not know how to access the already copied text . Also I do not know how to set the System variable once I have copied text in my program so I when I go to paste it in Notepad the proper text gets pasted.
If you can help me please do.
Thank -You

In case what you want is really to access the system clipboard:
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/datatransfer/Clipboard.html

Similar Messages

  • I have a 120gb Classic that has no space left on it. i am going to buy a larger gb capacity ipod as soon as i get clearer instruction on how to get the old ipod content to the new ipod. How do you get content from one ipod to the other?

    how do you get content from one ipod to the new one? my content is on an external hard drive not on my pc and i have run out of space on my 120gb classic. can you get old ipod content to new? my itunes has only got short cuts, the real content is on an external drive? can this be done?? please help

    If the content is on an external drive, but your library knows where to find it, then it should all work. Connect your device, make some selections for what to put on it, and sync. If, on the other hand, your current iPod is the only place holding some of your media then see this user tip: Recover your iTunes library from your iPod or iOS device.
    tt2

  • How do I get content from my iPad to show up on the tv screen using Apple TV without going thru iTunes?

    How can I get content from my iPad and my air book to show up on the tv screen using Apple TV, without going thru iTunes?

    You will need to use AirPlay to see that.
    Assuming both devices are on the same network and that AirPlay is not turned off on the Apple TV, then simply tap on the screen when you are watching content you wish to stream to your Apple TV, then tap the airplay icon that appears in the control bar, choose the Apple TV from the menu that appears.
    When displaying the content you wish to mirror on the iPad 2 (or better), iPad Mini, iPhone 4S (or better), double tap the home button (quickly) and swipe the bottom row of apps to the right to reveal the playback controls, tap the AirPlay icon and select your Apple TV from the list of available devices.

  • How do I get content from my old iPod Touch to my new iPhone 5?  My iPod Touch is too old to use iCloud

    How do I get content from my old iPod Touch to my new iPhone 5?  My iPod Touch is too old to use iCloud. I have activated the phone but am stick at the point of the set-up where my 3 choices are:
    1. Set up as new phone
    2.  Restore from icloud Backup
    3.  Restore from iTunes Backup
    thanks!

    If your iPod touch music is in your iTunes library, you just need to sync the new iPod nano with iTunes, the songs will be transfer to your new iPod. If not, you can follow this guide to transfer the songs from iPod touch to iTunes first, and then re-sync them to your new iPod. Hope it helps. Feel free to email me if you need further help.

  • How do i get content from my ipod touch to my new desk top computer

    how do i get content from my ipod touch to my new desktop computer?

    For iTunes purchases >  iTunes Store: Transferring purchases from your iPhone, iPad, or iPod to a computer

  • How do i get content from my touch to itunes on a new pc

    how do i get all content from my touch to itunes on a new pc?

    If you still have access to your Old computer... and...
    To have  EVERYTHING  as it is Now...
    From your OLD computer...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    Full Details Here  >  http://support.apple.com/kb/HT1751
    An Added Bonus is that you will have a Backup of iTunes.
    If not...
    Try these 2 User Tips...
    Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141
    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991

  • How do I set up automatic downloads so that i only get content from specific devices?

    Hello! I was wondering if there was a way I could set up automatic downloads so I only get content purchased from certain devices. I have a MacBook Pro and a ipod touch. I share an apple id with my family for itunes but have my own apple id for icloud. In my family we have various other apple products (iphones and ipads) and I dont want most of the things that my family would download on their devices - just the things would happen to download on my ipod and computer.
    Thanks for the help,
    J

    jackson_7 wrote:
    Hello! I was wondering if there was a way I could set up automatic downloads so I only get content purchased from certain devices.........
    That's not possible sorry.

  • My last pc crashed, how do i get content from ipod/iphone/ipad and previously purchased items back into itunes on pc?

    How do I get content back into itunes from ipod/iphone and ipad when old pc died and now have a blank itunes?

    check out this post by Zevoneer.

  • A way to get content from MONI to SAP BW?

    Hi,
    I'm a student and at the moment I'm working on a project to monitor the user behaviour on 40 SAP systems with 1 SAP BW.
    One source for that is the transaction st03n with the table MONI. As I know, the content from MONI can only be read out with ABAP and I haven't much experience with this programming language.
    So my questions:
    - Has anyone experience with reading out MONI with ABAP?
    - Is it possible to get the content in a file (csv) or in a DataSource so that SAP BW can read it?
    Thanks a lot for any help
    Joschi

    Thanks Bill,
    but as far as I know you first need to create a view over the table and then create a generic datasource with this view.
    But creating a view over this table isn't possible. You can only extract data from MONI with ABAP fundtions or extract the data with ABAP from the stat-files which are saved on the application-server.

  • Can't get content from PCD

    Hi,
    I've developed a small project to read content from pcd, in this case, to get roles attributes. I've followed this tutorial http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401?QuickLink=index&overridelayout=true, but I keep getting a NoClassDefFound for IPCDContext and PCDSearchConrols(if i choose to use this objet instead). I've added a DC of the External Library type to my project wich contained all the jars needed. Here's the code for my project:
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingEnumeration;
    import javax.naming.NamingException;
    import javax.naming.directory.DirContext;
    import java.lang.Object;
    import com.sap.portal.directory.Constants;
    import com.sap.portal.pcm.admin.PcmConstants;
    import com.sap.security.api.IRole;
    import com.sap.security.api.IUser;
    import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
    import com.sap.tc.webdynpro.services.sal.um.api.WDUMException;
    import com.sap.teste.wdp.IPrivateShowRoleView;
    import com.sapportals.portal.pcd.gl.IPcdContext;
    import com.sapportals.portal.pcd.pcm.roles.IPortalRole;
    import com.sapportals.portal.pcd.gl.IPcdAttribute;
    import com.sapportals.portal.pcd.gl.IPcdContext;
    import com.sapportals.portal.pcd.gl.IPcdSearchResult;
    import com.sapportals.portal.pcd.gl.PcdSearchControls;
    import com.sap.portal.pcm.admin.IAdminBase;
    import com.sap.portal.pcm.admin.IAttributeSet;
    import com.sap.portal.pcm.admin.ValidationException;
    import com.sap.tc.webdynpro.progmodel.api.WDValueServices;
    import com.sap.tc.webdynpro.progmodel.api.WDVisibility;
    import com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.pcd.gl.IPcdSearchResult;
      public void wdDoInit()
       IUser user = null;
        try{
             user = WDClientUser.getCurrentUser().getSAPUser();
        catch(WDUMException e){
             wdContext.currentContextElement().setResult(e.getMessage());
             Hashtable env = new Hashtable();     
         env.put(IPcdContext.SECURITY_PRINCIPAL, user);
         env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
         env.put(Constants.REQUESTED_ASPECT,   IPcdAttribute.PERSISTENCY_ASPECT);     
         InitialContext iCtx = null;
         try
              String iRoleDir = "pcd:portal_content/mmmarques/role_teste3";
              iCtx = new InitialContext(env);
              IPcdContext attrSet = (IPcdContext) iCtx.lookup(iRoleDir);
              attrSet.getAttributes("").get("com.sap.portal.pcd.gl.CreatedAt").get().toString();
              attrSet.getAttributes("").get("com.sap.portal.pcd.gl.LastChangedBy").get().toString();
              attrSet.getAttributes("").get("com.sap.portal.pcd.gl.LastChangedAt").get().toString();
              attrSet.getAttributes("").get("com.sap.portal.pcm.Title").get().toString();
         catch (Exception e) {
              wdContext.currentContextElement().setResult("failed");
    If anybody could help, I would be very grateful. Thanks in advance

    Also, when I try to build my external library DC I get the following warnings:
    createPublicParts:
      [pppacker] Packing public part 'ExternalLibs'
      [pppacker] Packed   1 file  for entity activation.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity bc.rf.framework_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity bc.rf.global.service.mime_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity bc.rf.global.service.pipeline_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity bc.rf.global.service.urlgenerator_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity bc.sf.framework_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity bc.util.public_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity com.sap.portal.navigation.api_service_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity com.sap.portal.navigation.helperservice_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity com.sap.portal.navigation.service_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity com.sap.portal.pcd.roleservice_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity com.sap.portal.themes.lafservice_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity com.sap.portal.usermanagementapi.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity com.sap.security.api.ep5.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity com.sap.security.api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity gl_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity km.shared.command_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity km.shared.repository.service.accessstatistic_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity km.shared.repository.service.app.subscription_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity km.shared.repository.service.timebasedpublish_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity km.shared.service.actioninbox_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity km.shared.ui.util_api.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity mail.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity ojdbc14.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity poi-3.0-rc4-20070503.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity poi-contrib-3.0-rc4-20070503.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity poi-scratchpad-3.0-rc4-20070503.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity prtapi.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity prtconnection.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity prtjndisupport.jar (Archive/Java Library)
      [pppacker] Packed   1 file  for entity tcepbcpcmadminapijava.jar (Archive/Java Library)
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\com.sap.portal.usermanagementapi.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\km.shared.repository.service.timebasedpublish_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\bc.rf.global.service.mime_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\prtconnection.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\bc.rf.framework_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\gl_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\poi-3.0-rc4-20070503.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\prtapi.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\bc.util.public_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\com.sap.portal.navigation.service_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\com.sap.portal.navigation.helperservice_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\activation.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\bc.sf.framework_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\com.sap.portal.themes.lafservice_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\com.sap.portal.pcd.roleservice_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\com.sap.security.api.ep5.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\com.sap.security.api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\tcepbcpcmadminapijava.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\prtjndisupport.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\km.shared.command_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\km.shared.ui.util_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\poi-contrib-3.0-rc4-20070503.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\bc.rf.global.service.pipeline_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\km.shared.service.actioninbox_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\km.shared.repository.service.app.subscription_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\bc.rf.global.service.urlgenerator_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\com.sap.portal.navigation.api_service_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\km.shared.repository.service.accessstatistic_api.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\ojdbc14.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\mail.jar
      [pppacker] WARNING: Can not overwrite file C:\Users\mmmarques\.dtc\1\DCs\sonae.com\ag360\jars_dc2\_comp\gen\default\public\ExternalLibs\lib\java\poi-scratchpad-3.0-rc4-20070503.jar
      [pppacker] Packed 31 entities for public part 'ExternalLibs'
         [timer] Packing of public part 'ExternalLibs' finished in 0.047 seconds
    Edited by: babonhas8 on Jul 22, 2011 11:16 AM

  • Computer harddrive failed- getting contents from ipod onto new harddrive?

    Itunes says that my ipod is synced with "another computer"- well, yes, it is synced with the hardrive that failed and no longer works.
    But Itunes does not seem to give the option of transfering the ipods contents onto the new hardrive (and os).
    I think I have 5 computers my purchased songs can be used on- I think I have used up 3 simply by reinstalling my OS over the last couple of years. But really, my songs are only on ONE computer. How do I delete the old accounts?
    And how do I transfer the contents onto my new harddrive- not just purchased songs but my entire mp3 collection that is on my ipod.?
    I did not back up my hardrive for about a year so I have about 100 songs that I never backed up- right now they exist only on my ipod.
    Thanx

    Be very careful when connecting an iPod full of music to an empty iTunes library.There is very real risk of permanently losing all the music.
    To prevent auto sync, before you connect the iPod go to the iTunes preferences and select "devices", then select "disable automatic syncing for iPhones and iPods".
    An alternative method is to connect the iPod whilst holding down the 'control+shift' keys and do not let them go until your iPod appears in iTunes.
    If you see a message that your iPod is associated with a different library and asks if you want to link to a new one, make sure you press "Cancel".
    If you should click on "Erase and Sync" will erase all the content currently on your iPod and it will be replaced with the content of the iTunes library you just connected to.
    When you've pressed cancel your iPod should appear in the iTunes source list under "devices" and allow you to change the update setting to manage the iPod content manually, and that will let you use your iPod for the time being without the risk of accidentally erasing the contents.
    Then do any of the following to transfer your music from iPod back to the computer/iTunes.
    For iTunes version 7 or later, then you can transfer purchased iTunes store music from the iPod to an authorized computer by using the "file/transfer purchases from iPod" menu. Note that the maximum of 5 authorized computers applies here.
    Find out how to do that here.
    How to copy iTunes purchases from an iPod or iPhone to a computer.
    For all other non purchased content (your own CDs etc), check out the instructions/suggestions here.
    Music from iPod to computer (using option 2). This a manual method using "hidden folders" and although it works, it is a little more involved than other methods.
    Much easier ways are to use one of the many 3rd party programs that copy music from the iPod to the computer.
    One of the most recommended is Yamipod. This is a free program that transfers music from iPod back to the computer. However, it does not transfer playcounts/ratings etc.
    Other free programs are Pod Player, SharePod and Floola and iDump and iPodRobot.
    If you want to recover just the structure of playlists from the iPod (and not the actual song files themselves), there's iRepo for Windows. which I understand has this feature along with all the standard features for these programs.
    iPodRip also has the feature enabling you to reconstruct playlists.
    There is also CopyTrans. This does preserve ratings/playcounts etc if those are important to you but this program is not free. It also supports video transfer.
    More information is contained here.
    Copying content from your iPod to your computer - The Definitive Guide.

  • Getting content from ipad to computer?

    my computer was wiped as it had a virus. my itunes libary wiped completely. i want to know how to get everything from my ipad, (pictures,apps,videos,music and tv programme episodes) back onto my computer. when i plug my ipad in it asks if i want to wipe it completely or wheter i want to upgrade to ios 6.1. i want to be able to get all my videos and tv programmes (despretely) and music onto my computer from my ipad. how can i do that without wiping it???

    Read the instructions in this very informative user tip.
    https://discussions.apple.com/docs/DOC-3141

  • How do I get content from my pc onto my iphone?!

    Anytime I sync my phone, all content (apps, music etc) are copied onto my iTunes account on my pc.. but not the other way around!
    When I downloaded the newest software (ios5), all my music was transferred to the pc.. and now I dont know how to get it back onto my iPhone!
    How do I transfer all music/apps from PC to iPhone?

    Move the content via flash drive, etc. The iPhone, by design, syncs iTunes media content with one and only one computer.

  • Help needed to get content from SOAPMessage response

    hi All
    i have a small problem with accessing the content of a SOAPMessage. the soap message would look like :
    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.
    xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
    " xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetAvailabilityRespon
    se xmlns="xxx"><Get
    AvailabilityResult>Y1</GetAvailabilityResult></GetAvailabilityResponse></soap:Bo
    dy></soap:Envelope>
    my problem is that i can only get a value from
    Source sourceContent = replySoap.getContent();
    which is the entire thing as above. how can i get the value from <GetAvailabilityResult> element? i tried to do the steps like, get the SOAP part, and then the SOAP Envelope and then the SOAP Body from SOAPMessage, but all turned out to be null. only the content has a value. thanks for ur help in advance.

    When I open scanner and camera wizard on my computer, it does try to communicate with the phone. Then a box shows that it is imagining device is busy, or may be in use by another application. I can choose to cancel or wait till the device will be available. When I open properties it does the same, it never opens the properties, Is that helpful? .

  • Get content from html page

    Hey guys, Im looking at accessing a webpage, downloading the content then stripping out the parts i want.
    http://sunsolve.sun.com/search/document.do?assetkey=1-34-9-1
    For example, I would like to be left with just the patches and their information, not the heading and intro. Where should i start?

    here is some class that can read an URL:import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    import java.io.OutputStream;
    import java.net.URLEncoder;
    public class test {
         public static void main(String args[]) {
              if(args.length!=0){
                   new test(args);
              new test();
         public test() {
              this.openURL("http://www.google.com",null);
         public test(String[] args){
              int i = 0;
              while(i<args.length){
                   // do something with the encoding, I am assuing utf-8
                   // but the openURL method can check the header for you
                   try{
                        System.out.println(new String(this.openURL(args,null),"UTF-8"));
                   }catch(Exception e){
                        e.printStackTrace();
                   i++;
         public byte[] openURL(String urlpath,URL u) {
              // it is VERRY importaint to read the entire response
              // if you want to connect to the same server again
              // this is because closing the inputstream does not close the socket
              // and response data from a previous request could be mixed up with the current
              InputStream is;
              OutputStream os;
              byte[] buf = new byte[1024];
              URLConnection urlc = null;
              try {
                   URL a = null;
                   if(u!=null){
                        a = u;
                   }else{
                        a = new URL(urlpath);
                   urlc = a.openConnection();
                   urlc.setDoOutput(false);
              // either setDoOutput to false or Post some info
    //               os = urlc.getOutputStream();
    //               String name = "key="+URLEncoder.encode("value", "UTF-8");
    //               os.write(name.getBytes("UTF-8"));
    //               os.close();
                   is = urlc.getInputStream();
                   int len = 0;
                   ByteArrayOutputStream bos = new ByteArrayOutputStream();
                   while ((len = is.read(buf)) > 0) {
                        bos.write(buf, 0, len);
                   // close the inputstream
                   is.close();
                   return bos.toByteArray();
              } catch (Exception e) {
                   e.printStackTrace();
                   try {
                        // now failing to read the inputstream does not mean the server did not send
                        // any data, here is how you can read that data, this is needed for the same
                        // reason mentioned above.
                        ((HttpURLConnection) urlc).getResponseCode();
                        InputStream es = ((HttpURLConnection) urlc).getErrorStream();
                        int ret = 0;
                        // read the response body
                        while ((ret = es.read(buf)) > 0) {
                        // close the errorstream
                        es.close();
                   } catch (IOException ex) {
                        ex.printStackTrace();
                        // deal with the exception
              return new byte[0];
    Here is some code to set a proxy// IF YOUR PROXY NEEDS AUTHENTICATION
    //The base64encoder is part of the w3c tools
    //download jigsaw and look for the base64,,, file
    //http://www.google.nl/search?hl=nl&q=site%3Aw3c.org+jigsaw&lr=
    //compiled it and put it in [jre home]/lib/ext
    //put this jar file in the classpath when you compile
    String proxyUrl = "myproxy";
    String user = "myUser";
    String password = "myPassword";
                   URLConnection conn = url.openConnection();
                   if(proxyUrl!=null){
                        System.getProperties().put( "proxySet", "true" );
                        System.getProperties().put( "proxyHost", proxyUrl );
                        System.getProperties().put( "proxyPort", "80" );
                        pwd = user + ":" + password;
                        Base64Encoder enc  = new Base64Encoder(password);
                        encodedPassword = enc.processString() ;
                        // optional
                        conn.setRequestProperty( "Proxy-Authorization", encodedPassword );
                   // start opening output or inputstream on the connection

Maybe you are looking for