Thanks for taking your time to help me.
I have a problem with the "non-static ..." error and I don't know why. Here's the code
public class Klient {
public static String output = "test";
public static void main(String[] args) throws Exception {
Socket socket = new Socket("localhost", 9898);
PrintStream PS = new PrintStream(socket.getOutputStream());
InputStreamReader IR = new InputStreamReader(socket.getInputStream());
BufferedReader BR = new BufferedReader(IR);
int i;
for (i = 0; i < 3; i++) {
output = BR.readLine();
Server2.setTekst(output);
}
(This is just a part of the code. I know this ends while paraphrasing)
And the other class:
public class Server2 extends JFrame implements Runnable {
konsol = new JTextPane();
konsol.setEditable(false);
public void setTekst(String tekst) {
konsol.setText(tekst);
}
public void run() {
instance = new Server2();
instance.setVisible(true);
}
}
Again, this is also just a part of the code. I would really appreciate your help :)