|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
worker.MWorker
public class MWorker
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
MWorker(int port,
java.lang.String serverIP,
java.lang.String nic,
ClientGUI gui)
The constructor of MWorker.. |
Method Summary | |
---|---|
ClientGUI |
accessGUI()
|
java.lang.String |
getIPAdress()
BE AWARE! - THIS METHOD SHOULDN'T BE USED ANY LONGER! |
javax.swing.DefaultListModel |
getListModel()
|
java.lang.String |
getNic()
|
void |
logon()
This method just sends a logon-message to the server (ip-adress configured when created new MWorker object!) |
void |
run()
.. |
void |
sendFile(java.lang.String recipiant,
java.io.File file)
This is the main file-sending method! |
void |
sendMessage(java.lang.String recipiant,
java.lang.String msg)
This method is the main message-sending method! |
void |
setNewListModel(javax.swing.DefaultListModel dlm)
This tiny method updates the userlist in the GUI. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MWorker(int port, java.lang.String serverIP, java.lang.String nic, ClientGUI gui)
port
- ... the port on which messages will be sentserverIP
- ... the ip-adress of the server you're communicating withnic
- ... the client nicknamegui
- ... the ClientGUIMethod Detail |
---|
public javax.swing.DefaultListModel getListModel()
public void setNewListModel(javax.swing.DefaultListModel dlm)
dlm
- ... the new DefaultListModel (list of available users)public void logon()
public void sendMessage(java.lang.String recipiant, java.lang.String msg) throws java.lang.Exception
recipiant
- ... username of the user you want to send the message to!msg
- ... the message you want to send in form of a String.
java.lang.Exception
public void sendFile(java.lang.String recipiant, java.io.File file) throws java.lang.Exception
recipiant
- ... username of the user you want to send the message to!file
- ... the File you want to send to a user (java.io.File)
java.lang.Exception
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.lang.String getIPAdress() throws java.lang.Exception
java.lang.Exception
public java.lang.String getNic()
public ClientGUI accessGUI()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |