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

Thread: writing a program to interface with other programs

  1. #1
    Member
    Join Date
    Oct 2010
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default writing a program to interface with other programs

    There must be some mechanism that windows provides that allows an application programmed in whatever language to interface with other programs running on the same computer.

    Specifically, I will be beginning a project soon in which I have to program in Java an application that reads from a dxf file and produces a plan/model from it in AutoCAD. It needs some kind of I/O channel opened so as to send it instructions to AutoCAD (ex. draw line, make face, create new layer, etc.).

    Does Windows have resources/mechanisms that allow one to do this in Java?


  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: writing a program to interface with other programs

    It is going to be application dependent - if the application you wish to send information to doesn't listen for information sent to it then there isn't really a mechanism to do so. You could write a file in the format of said application, but it wouldn't be on the fly. Often, data is sent dynamically to an application via port/socket communication - so I recommend investigating whether AutoCAD has this capability.

  3. #3
    Member
    Join Date
    Oct 2010
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: writing a program to interface with other programs

    Thanks copeg, I will look into port/socket communication.

    My first thought was that my Java application could somehow "borrow" the user input channels (i.e. keyboard and mouse) and send info as if it were the devices on those channels. Is this a possibility?

  4. #4
    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: writing a program to interface with other programs

    Quote Originally Posted by gib65 View Post
    Thanks copeg, I will look into port/socket communication.

    My first thought was that my Java application could somehow "borrow" the user input channels (i.e. keyboard and mouse) and send info as if it were the devices on those channels. Is this a possibility?
    Have a look at the Robot class.
    Robot (Java Platform SE 6)
    No guarantees it will fit your needs, but it might be worth a quick test to see

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: writing a program to interface with other programs

    Too late, he already got help elsewhere and neglected to update this thread.

    This thread has been cross posted here:

    http://www.java-forums.org/advanced-java/50782-writing-program-interface-other-programs.html

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting

    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. The Following User Says Thank You to KevinWorkman For This Useful Post:

    copeg (November 4th, 2011)

  7. #6
    Member
    Join Date
    Oct 2010
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: writing a program to interface with other programs

    Yes, I came across that myself. Looking into it. Thanks.

  8. #7
    Member
    Join Date
    Oct 2010
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: writing a program to interface with other programs

    Quote Originally Posted by KevinWorkman View Post
    Too late, he already got help elsewhere and neglected to update this thread.

    This thread has been cross posted here:

    http://www.java-forums.org/advanced-java/50782-writing-program-interface-other-programs.html

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting

    Doh! I forgot about being forward about cross-posting!!!

    Sorry about that. I should know better - because I do know better.

    I only forgot because I'm really anxious to figure out how to do this because my butt is on the line, and being forward about my cross-posts kinda slipped on my priority list (not to mention my memory) - that's no excuse, I realize, but for what it's worth: every answer I get is useful! I mean it: I've never come across an answer that was exactly the same as every other one.

    So I do appreciate the time and information provided to me by those willing to give it.

    And I promise I will remember to mention my cross-posts next time (I'm writing it on a sticky as we speak ).

Similar Threads

  1. [SOLVED] Writing a program with arrays and class methods... PLEASE HELP?
    By syang in forum What's Wrong With My Code?
    Replies: 17
    Last Post: August 8th, 2011, 07:02 AM
  2. Student Programs
    By Suzanne42 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 26th, 2011, 09:20 AM
  3. Question about writing a phonebook sorting program
    By Stockholm Syndrome in forum Java Theory & Questions
    Replies: 2
    Last Post: March 25th, 2011, 09:25 AM
  4. What programs shall i make?
    By DarrenReeder in forum Java Theory & Questions
    Replies: 1
    Last Post: December 27th, 2009, 08:31 AM
  5. I need help writing this program
    By kev2000 in forum Algorithms & Recursion
    Replies: 5
    Last Post: June 4th, 2009, 03:14 AM