I am creating a thread in my main class. There is a timer in the stream that writes and reads on the socket.
I need to call a method in a thread class, for example writeSomething () from another class outside of where it was declared (Main).
How does an object refer to another class?
Edit
public static Thread connectionThread; ModelJTable table = new ModelJTable(); connectionThread = new Thread(new ConnectionThread(table), "connectionThread"); connectionThread.start();
I have a method in a thread class
public void openFile(String fileName){ String request = "open;" + fileName; out.print(request); }
I want to access if from another class (JTable class)
String open = "open;" + getname + ";" + getpath;
This call causes an error.
There is no instance of the ConnectionThread type in Volume
source share