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

Thread: is it possible to connect 2 java applications in different packages ?

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default is it possible to connect 2 java applications in different packages ?

    I have written 2 different applications ( so they are 2 different projects/packages). How can I do : by clicking a button in a jframe in first app, the jframe in second app appears ? for example first app is "login" and second app is "register a new user". It has a button in login jframe which clicking that, leads to "register a new user" in application 2 !

    I do not want to integrate 2 applications because it gave me so many errors. I just want to make a connection between them. is it possible ??


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

    Default Re: is it possible to connect 2 java applications in different packages ?

    What do you mean by a "connection"?
    One easy way to start the execution of a class that has a static method (main is static) is to call that static method.

    Another way is to call a constructor of a class. Ie use new to create an instance of the other class.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: is it possible to connect 2 java applications in different packages ?

    I mean : by clicking a button, the second jframe from another package may shown . the second jframe has separate functionality than the first jframe (from first package)

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

    Default Re: is it possible to connect 2 java applications in different packages ?

    by clicking a button,
    Add a listener to the button. When the listener method is called, use one of the techniques listed in post#2 to call the other class's methods.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Learning Java programming for developing Mobile Applications
    By Adrianvince7 in forum Java Theory & Questions
    Replies: 2
    Last Post: November 9th, 2012, 03:46 PM
  2. How do I import user defined packages to my java application.
    By kunalgaurav18 in forum Java Theory & Questions
    Replies: 6
    Last Post: October 11th, 2012, 01:41 PM
  3. Setting up Directory Structure in Java Applications
    By Jyotirmoy in forum Member Introductions
    Replies: 0
    Last Post: July 28th, 2011, 05:28 AM
  4. Meaning of Java Packages
    By Effrego in forum Java Theory & Questions
    Replies: 1
    Last Post: February 5th, 2011, 05:18 PM
  5. Replies: 0
    Last Post: June 18th, 2010, 07:18 AM