Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28
Like Tree2Likes

Thread: open a class from another

  1. #21
    mharsijamel is offline Member
    Join Date
    Aug 2011
    Posts
    60
    Rep Power
    0

    Default Re: open a class from another

    Quote Originally Posted by Norm View Post
    Can you explain what your problem is?
    my problem is:
    when i made shrimp like first run class : it run correctly
    when i made authentifier first run class: when the authentification is made correctly, the execution is stopped without runnig shrimp

  2. #22
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,816
    Rep Power
    25

    Default Re: open a class from another

    the execution is stopped without runnig shrimp
    It does run Shrimp as you said:
    it will use the default constructor
    If you don't understand my response, don't ignore it, ask a question.

  3. #23
    mharsijamel is offline Member
    Join Date
    Aug 2011
    Posts
    60
    Rep Power
    0

    Default Re: open a class from another

    it will use the default constructor: i mean that normally in java if no constructor there it wil execute the default constructor
    but my problem in all this: i want to know why shrimp doesn't start when i call it from authentifier

  4. #24
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,816
    Rep Power
    25

    Default Re: open a class from another

    why shrimp doesn't start when i call it from authentifier
    The Shrimp class's default constructor is called from Authentifier, BUT
    There is no code in the Shrimp class's default constructor, so you can not see anything that happened.
    You must change the Shrimp class if you want anything to happen.

    This problem has been pointed out, discussed and asked about many times in this thread. Go back and reread all the posts that have been made.
    If you don't understand my response, don't ignore it, ask a question.

  5. #25
    mharsijamel is offline Member
    Join Date
    Aug 2011
    Posts
    60
    Rep Power
    0

    Default Re: open a class from another

    Quote Originally Posted by Norm View Post
    The Shrimp class's default constructor is called from Authentifier, BUT
    There is no code in the Shrimp class's default constructor, so you can not see anything that happened.
    You must change the Shrimp class if you want anything to happen.

    This problem has been pointed out, discussed and asked about many times in this thread. Go back and reread all the posts that have been made.
    could you help how could i change my shrimp class?

  6. #26
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,816
    Rep Power
    25

    Default Re: open a class from another

    Move all the code from the main() method to the constructor.
    If you don't understand my response, don't ignore it, ask a question.

  7. #27
    mharsijamel is offline Member
    Join Date
    Aug 2011
    Posts
    60
    Rep Power
    0

    Default Re: open a class from another

    i can't because i have the operator "args" that must stay in main
    but i succeeded to do it( i moved a half of code that can be moved and i keep the other code)

  8. #28
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,816
    Rep Power
    25

    Default Re: open a class from another

    You'll have to study the design and logic for the code and change it as needed or possible for your requirements.
    If you don't understand my response, don't ignore it, ask a question.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. how to open class(jpanel) from external jar?
    By skadron_alfa in forum New To Java
    Replies: 3
    Last Post: 01-15-2012, 06:41 AM
  2. Replies: 6
    Last Post: 07-25-2011, 11:34 AM
  3. how can i open a .class in a text editor
    By footballdude2k3 in forum New To Java
    Replies: 1
    Last Post: 04-14-2011, 10:00 PM
  4. Open next class help
    By Tastosis in forum New To Java
    Replies: 2
    Last Post: 03-04-2011, 02:12 AM
  5. How do I open a file with a class, or can I?
    By bobleny in forum New To Java
    Replies: 4
    Last Post: 04-02-2009, 10:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •