Thread: Make a java file (using java codes from other java file)

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Make a java file (using java codes from other java file) 
    Banned

    Join Date
    Jan 2007
    Posts
    518
    Thanks given
    1
    Thanks received
    3
    Discord
    View profile
    Rep Power
    0
    Please dont flame me and say its an easyer way to do it.
    I'm just adding what i use to add.

    To start off, make a new file you call test.java and add this in it:
    Inside there, add this:

    Code:
    public class [Filename] {
    so in this example we use this:

    Code:
    public class test {
    after that, add this:

    Code:
    public void testvoid(client c) {
    The client c means you load variables from client.class (client.java).
    inside there you can start.

    Code:
    c.sendMessage("test, test");
    }
    you see? use the c. before the variable which is in your client.class.
    after that you should end your public class.
    Its just to add a bracket.
    Now your file would look like this:

    Code:
    public class test {
    public void testvoid(client c) {
    c.sendMessage("test, test");
    }
    }
    That was the .java file.
    Now go to server.java.

    Find this code:

    Code:
    (new Thread(clientHandler)).start();
    add this under it:

    Code:
    test = new test();
    its like this: [filename] = new [filename]();

    find the process stuffs or just search for playerHandler.process();

    do the same there. [filename].process();
    so in this example we use this: test.process();

    scroll down to your statics, or just search for this:
    public static PlayerHandler playerHandler = null;

    add the same.. public static [filename] [filename] = null;
    so in this example we use this: public static test test = null;

    now save and close server.java.
    open up client.java.

    At your action, f.example a command, add this.

    Code:
    server.test.testvoid(this);
    so thats like this. server.[filename].[variable in filename](this);

    As command, you could add this.

    Code:
    if(command.equalsIgnoreCase("blablabla")) {
    server.test.testvoid(this);
    }

    if the method in the test.java were like this: public void testvoid(int test, client c)
    Then, in your client.java, you should edit server.test.testvoid(this); to server.test.testvoid(test, this);

    So if you add anything inside (), then do the same with the server.test.testvoid(this); too..
    Just dont add like this: server.test.testvoid(client c, test)
    You dont need client c, cause its not a variable.

    Hope this helps someone

    - Izzane
     

  2. #2  
    Member #35, most veteran member left? :D


    Join Date
    Jul 2006
    Age
    27
    Posts
    2,663
    Thanks given
    53
    Thanks received
    331
    Rep Power
    925
    Even though Santa Clause made one a lot like this (before you made this one), and it was more in-depth, this is still pretty good. I guess you deserve some reputation for your attempt to help.
    [Only registered and activated users can see links. ]

    `Ex-global moderator x3 (resigned)
     

  3. #3  
    JavaŠ
    Guest
    wow he got ub3r runite rep for that *Runs off to make some uber tuts*
     

  4. #4  
    Banned

    Join Date
    Jan 2007
    Posts
    518
    Thanks given
    1
    Thanks received
    3
    Discord
    View profile
    Rep Power
    0
    Quote Originally Posted by Runite View Post
    Even though Santa Clause made one a lot like this (before you made this one), and it was more in-depth, this is still pretty good. I guess you deserve some reputation for your attempt to help.
    I remember santa clause's tut, yes.
    But I dont think he explained it so very good for new peoples
    Thanks for feedback

    - Izzane
     

  5. #5  
    Member #35, most veteran member left? :D


    Join Date
    Jul 2006
    Age
    27
    Posts
    2,663
    Thanks given
    53
    Thanks received
    331
    Rep Power
    925
    Well, sorry to spam your thread, but I guess your right. I had a bit of trouble following it after I came back from my break from private servers. Oh well, since I already knew how to do this before this tutorial, I can't really be the judge of how in-depth it is. Ah well, you'll need some more comments to know for sure

    Wow, this flood limit timer is terrible. Rebel against flood limit?
    [Only registered and activated users can see links. ]

    `Ex-global moderator x3 (resigned)
     

  6. #6  
    Banned

    Join Date
    Jan 2007
    Posts
    518
    Thanks given
    1
    Thanks received
    3
    Discord
    View profile
    Rep Power
    0
    Quote Originally Posted by Runite View Post
    Well, sorry to spam your thread, but I guess your right. I had a bit of trouble following it after I came back from my break from private servers. Oh well, since I already knew how to do this before this tutorial, I can't really be the judge of how in-depth it is. Ah well, you'll need some more comments to know for sure

    Wow, this flood limit timer is terrible. Rebel against flood limit?
    I agree with the timer stuffs
    Runite, you gave me from 159 to 208 rep

    - Izzane
     

  7. #7  
    Member #35, most veteran member left? :D


    Join Date
    Jul 2006
    Age
    27
    Posts
    2,663
    Thanks given
    53
    Thanks received
    331
    Rep Power
    925
    Quote Originally Posted by Izzanerod View Post
    I agree with the timer stuffs
    Runite, you gave me from 159 to 208 rep

    - Izzane
    Gah! More spam. I'm uber elite sorreez. Anywho, the timer does suck, and I know I gave you that much rep. I have/had 49 rep power.
    [Only registered and activated users can see links. ]

    `Ex-global moderator x3 (resigned)
     

  8. #8  
    Banned

    Join Date
    Jan 2007
    Posts
    518
    Thanks given
    1
    Thanks received
    3
    Discord
    View profile
    Rep Power
    0
    Ok. Back to topic now

    - Izzane
     

  9. #9  
    Member #35, most veteran member left? :D


    Join Date
    Jul 2006
    Age
    27
    Posts
    2,663
    Thanks given
    53
    Thanks received
    331
    Rep Power
    925
    I think maybe you should add a couple of more things about making JAVA files, and go a bit more in-depth on a few parts.
    [Only registered and activated users can see links. ]

    `Ex-global moderator x3 (resigned)
     

  10. #10  
    Banned

    Join Date
    Jan 2007
    Posts
    518
    Thanks given
    1
    Thanks received
    3
    Discord
    View profile
    Rep Power
    0
    I did. Thanks, Runite.

    - Izzane
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. how to make java file ?
    By Kenaboy in forum Application Development
    Replies: 5
    Last Post: 11-03-2010, 09:39 AM
  2. How Can I Make A .Java File?
    By Yanille-City in forum Help
    Replies: 4
    Last Post: 07-29-2009, 06:55 PM
  3. How to make java UPLOAD a file?
    By dark bl00d23 in forum Requests
    Replies: 2
    Last Post: 03-30-2009, 02:13 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •