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: how to connect a program to another program?

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to connect a program to another program?

    How to connect your program to another program? And how many program can be connected?

    .well i want to call another program, e.g Theres a 3 buttons "red, blue, green" : when i click red, its going to call a program to add the numbers. when i click green, its going to call another program to subtract. and when i click blue, its going to call another program to divide. So there are 4 programs to connect. The RED, BLuE, Green and the Main program. ^^


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how to connect a program to another program?

    How to connect your program to another program? And how many program can be connected?
    I'm not sure what you mean by "connect". If you are asking about one class having a reference to another class that it can use to call methods in the other class, there are no limits to the number of references to other classes that a class can have.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how to connect a program to another program?

    how sir? what code should i use ^^

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how to connect a program to another program?

    Use the new statement to create instances of a class.
    OtherClass oCls = new OtherClass();  //  create an instance of OtherClass
     
    oCls.someMethod(); //  call method in OtherClass
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Apr 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how to connect a program to another program?

    can you give me n exmple program,, please

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how to connect a program to another program?

    See post#4.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Apr 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how to connect a program to another program?

    thnks sir .. im sorry i didnt notice

Similar Threads

  1. Invoke a Java program with windows program
    By jackhard in forum Object Oriented Programming
    Replies: 1
    Last Post: February 21st, 2013, 07:16 AM
  2. Program goes into infinite compilation. University project - Library Program.
    By clarky2006 in forum What's Wrong With My Code?
    Replies: 35
    Last Post: November 10th, 2012, 03:56 PM
  3. Cannot connect Java program to database
    By perry.matthew in forum JDBC & Databases
    Replies: 2
    Last Post: August 29th, 2012, 10:54 AM
  4. Replies: 1
    Last Post: July 8th, 2012, 10:23 AM
  5. Connect 4 program
    By robbeh in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 30th, 2012, 12:44 PM

Tags for this Thread