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
Type: Posts; User: beginner123
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
i have attached the files
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;
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...
yes i did test it and it worked. thats why i started making the changes because the code was fine
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...
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;
ok the problem is the login page its not running the actionPerformed function when the button is clicked.
how can i fix this code?
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
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
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...
i already have some code in an ActionPerformed event for the button. how do i add an ActionListener?
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...
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...
not really sure how to do that.
i tried this in the jTextArea1KeyReleased event:
if (Words.equals(Words))
{
generateNextWord();
}
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...
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;
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,...