Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Not Getting "SourceURL" When content copied form browser using Clipboard java

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Not Getting "SourceURL" When content copied form browser using Clipboard java

    I am not able to get the "SourceURL" when Content is copied from any Browser using java.awt.datatransfer.Clipboard, even this information is already available on System Clipboard.
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        Transferable t = clipboard.getContents(null);
        DataFlavor dfs[] = t.getTransferDataFlavors();
        for(DataFlavor df : dfs){
        try {
        System.out.println(t.getTransferData(df));
        } catch (Exception ex) {
        ex.printStackTrace();
        }
        }

    Please any one could help me to find "SourceURL"


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 286 Times in 225 Posts
    Blog Entries
    4

    Default Re: Not Getting "SourceURL" When content copied form browser using Clipboard java

    Welcome to the forums Anuj.

    I think we are going to need some more information. What is the SourceURL?
    I have tested the code you have posted and it works although I'm not sure if all the output is what you are expecting.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,560
    Thanks
    45
    Thanked 1,954 Times in 1,928 Posts

    Default Re: Not Getting "SourceURL" When content copied form browser using Clipboard java


  4. #4
    Junior Member
    Join Date
    Jul 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Not Getting "SourceURL" When content copied form browser using Clipboard java

    i wants 2 outputs
    1. Content which is copied.
    2. if Content is copied form any web page, i need that URL of the wab page also.

    For more information : Bug ID: 6392086 Copy to clipboard with html mime type fails with input stream

  5. #5
    Junior Member
    Join Date
    Jul 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Not Getting "SourceURL" When content copied form browser using Clipboard java

    Clipboard and text/html Dataflavor in Windows

Similar Threads

  1. Replies: 6
    Last Post: November 12th, 2010, 03:40 AM
  2. Java says:"Hello World". I say:"It works!"
    By Davidovic in forum Member Introductions
    Replies: 4
    Last Post: June 29th, 2010, 07:13 AM
  3. "java.lang.NoSuchMethodError: main" and "fatal exception occured."
    By joachim89 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2010, 07:35 AM
  4. Replies: 1
    Last Post: October 25th, 2009, 11:54 AM
  5. Replies: 4
    Last Post: August 13th, 2009, 05:54 AM

Tags for this Thread