Search:

Type: Posts; User: beginner123

Search: Search took 0.09 seconds.

  1. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    and here is the orignal file where i got the code.
    bascially all i want to do is take this file and put the code into a JFrame so its easier to add more features and move things around
  2. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    i have attached the files
  3. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    ok here is all 3 files (sorry for all the extra stuff netbeans puts in):


    import java.io.*;
    import java.net.*;
    import java.util.*;

    public class MyServer{
    ServerSocket ss;
    Socket s;
  4. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    sorry i though you mean't the code i just posted a minute ago - that code is fine. maybe compare the two and see whats the problem?
    i didnt change any of the code. i just want the code to work using...
  5. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    yes i did test it and it worked. thats why i started making the changes because the code was fine
  6. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    I am using netbeans

    --- Update ---

    i got this code from a website. here is the orginal code:
    i
    mport javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import...
  7. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    that is because i didnt post the 3rd file
    here it is:


    import java.io.*;
    import java.net.*;
    import java.util.*;

    public class MyServer{
    ServerSocket ss;
  8. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    ok the problem is the login page its not running the actionPerformed function when the button is clicked.
    how can i fix this code?
  9. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    ok so i changed String name to static String name; and now the error is gone
    but the client page is still not displaying when i click the login button on the login page
  10. Replies
    22
    Views
    1,271

    Re: frame is not opening in chat application

    I tried that. I changed the code to new MyClient(name).setVisible(true);
    and the error says non static variable name cannot be referenced from a static context
  11. Replies
    22
    Views
    1,271

    frame is not opening in chat application

    I'm making a chat application using client/server. I have 3 files - server, login and client.
    Nothing is happening when I click the login button, It should open the client page.

    I am getting an...
  12. Re: how to check if a button has been pressed?

    i already have some code in an ActionPerformed event for the button. how do i add an ActionListener?
  13. how to check if a button has been pressed?

    so i have a simple typing game where the user clicks the start button and 10 random words appear at the top of the screen. The user then has to enter these words into the texbox and press the space...
  14. Replies
    12
    Views
    1,460

    Re: how do you compare words?

    yes i know using if (Words.equals(Words)) is wrong. I know i need some kind of loop.

    I thought maybe i would use the jTextArea1KeyReleased event so when the last letter of the word being typed is...
  15. Replies
    12
    Views
    1,460

    Re: how do you compare words?

    not really sure how to do that.
    i tried this in the jTextArea1KeyReleased event:


    if (Words.equals(Words))
    {
    generateNextWord();

    }
  16. Replies
    12
    Views
    1,460

    Re: how do you compare words?

    here is my code for the array:

    Random r = new Random();


    public int randomNumber;
    public String[] Words = new String[10];
    public int WordCounter=0;
    public int...
  17. Replies
    12
    Views
    1,460

    Re: how do you compare words?

    ok here is some of the code:

    this is my basic array with 10 words


    public int randomNumber;
    public String[] Words = new String[10];
    public int WordCounter=0;
  18. Replies
    12
    Views
    1,460

    how do you compare words?

    I am trying to make a typing game where random words come on the screen and the user has to type the word out in the textarea.
    I created an array with 10 words which a displayed using a label,...
Results 1 to 18 of 18