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 9 of 9

Thread: Interaction with external application

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Interaction with external application

    Hi all, this is my first post...I'm sorry that I'm writing in the wrong place but I haven't find a better place.

    Now: I'm programming with Java from one year and I have studied the basis and graphical java but I'm not able to make my program communicate with other things...

    So my question is:

    is it possible that a java program write (for example) in the search box (of google) something? and then click on the first (or second or whatever we want ) link ?

    I mean that I'm trying to build a simple program that for example (given by the user the word "JAVA") goes to google page and write in the search box "JAVA" and then choose a link .

    I hope that you have understood my question...

    for more information don't hesitate and post question...

    By by...


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Interaction with external application

    Possibly not directly (that I know of). What you could do is have the program do the google search using a URL and URLConnection, parse the results, and choose a link that way. Then use the Desktop class to open up that particular link with the default browser. See How to graph html source of website url for more info on making the URLConnection

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Interaction with external application

    The Robot class can position the cursor on the screen and type there and move the cursor and click.
    However it can't easily see what is at the locations it moves the cursor to. If the page in the browser's window can be kept to the same location on the screen, Robot might work.

  4. #4
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: Interaction with external application

    Copeg's suggestion is good, but I'd suggest not hitting Google in that way as non-browser access is against their terms of use. No, I don't have a reference for that but you could search Google

    db

  5. #5
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Interaction with external application

    Quote Originally Posted by Darryl.Burke View Post
    Copeg's suggestion is good, but I'd suggest not hitting Google in that way as non-browser access is against their terms of use. No, I don't have a reference for that but you could search Google

    db
    Thanks for the clarification DB. I had the some hesitation when posting that reply due to the terms of use, but in my haste neglected to mention them

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

    Default Re: Interaction with external application

    Quote Originally Posted by copeg View Post
    Thanks for the clarification DB. I had the some hesitation when posting that reply due to the terms of use, but in my haste neglected to mention them
    If you spoof the connection to look like a browser, they will never know
    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.

  7. #7
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4
    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.

  8. #8
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: Interaction with external application

    You know that you can get an imacro add-on for Firefox.

  9. #9
    Junior Member
    Join Date
    Sep 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Interaction with external application

    Hi all...

    Thanks a lot for the replies... I think that I'm gonna to read about robot class...

    by by...

Similar Threads

  1. [SOLVED] How to write to an application
    By straw in forum Java Theory & Questions
    Replies: 4
    Last Post: June 19th, 2010, 10:17 AM
  2. [SOLVED] [help] the application file (.jad) for application does not appear to be the ....
    By ordinarypeople in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: April 4th, 2010, 03:50 AM
  3. Replies: 0
    Last Post: December 3rd, 2009, 04:43 PM
  4. **Help!** Capturing external circuit data to GUI Jpanel
    By ROTNEVNI in forum AWT / Java Swing
    Replies: 2
    Last Post: November 27th, 2009, 09:40 AM
  5. How to link two classes in java to use it method
    By Sterzerkmode in forum Object Oriented Programming
    Replies: 3
    Last Post: May 13th, 2009, 06:52 AM