Click here to Skip to main content
15,890,512 members
Home / Discussions / Java
   

Java

 
GeneralRe: Main method Pin
Richard MacCutchan15-Sep-11 22:20
mveRichard MacCutchan15-Sep-11 22:20 
GeneralRe: Main method Pin
jschell17-Sep-11 14:46
jschell17-Sep-11 14:46 
GeneralRe: Main method Pin
Richard MacCutchan17-Sep-11 21:22
mveRichard MacCutchan17-Sep-11 21:22 
GeneralRe: Main method Pin
Nagy Vilmos15-Sep-11 23:07
professionalNagy Vilmos15-Sep-11 23:07 
GeneralRe: Main method Pin
David Skelly16-Sep-11 2:12
David Skelly16-Sep-11 2:12 
QuestionMultiple Client/Server Chat messaging problem [modified] Pin
alli7712-Sep-11 14:13
alli7712-Sep-11 14:13 
AnswerRe: Multiple Client/Server Chat messaging problem Pin
Richard MacCutchan12-Sep-11 21:31
mveRichard MacCutchan12-Sep-11 21:31 
AnswerRe: Multiple Client/Server Chat messaging problem Pin
Nagy Vilmos12-Sep-11 22:31
professionalNagy Vilmos12-Sep-11 22:31 
I'll give you some general tips to start with:
0. The client needs to run on two threads, one to receive messages and one to send. Normally the main thread will be the sending thread and also the UI.
1. I would separate the communication from the processing into two classes. Have another class in the server, something like ClientSession that deals with any logic. This would have the name of the client session and a reference to the main chat server.
2. As with the connection, the server should be separated into UI and logic. By having these separated it will eb clearer to see what is what. A simple call-back from the server will update the UI.
3. Check your names, you have so many different styles it becomes confusing. Do not use underscores. All variables should use camel case likeThis and classes should be pascal case ThisWay.


Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

QuestionNumber problems Pin
Liam S. Crouch11-Sep-11 7:03
Liam S. Crouch11-Sep-11 7:03 
AnswerRe: Number problems Pin
Gerben Jongerius11-Sep-11 7:21
Gerben Jongerius11-Sep-11 7:21 
AnswerRe: Number problems Pin
Richard MacCutchan11-Sep-11 7:31
mveRichard MacCutchan11-Sep-11 7:31 
AnswerRe: Number problems Pin
Luc Pattyn11-Sep-11 7:45
sitebuilderLuc Pattyn11-Sep-11 7:45 
GeneralRe: Number problems Pin
TorstenH.11-Sep-11 22:47
TorstenH.11-Sep-11 22:47 
AnswerRe: Number problems Pin
Charles Putney13-Sep-11 1:47
Charles Putney13-Sep-11 1:47 
Questionhi Pin
GANESH238911-Sep-11 3:23
GANESH238911-Sep-11 3:23 
AnswerRe: hi Pin
Richard MacCutchan11-Sep-11 4:03
mveRichard MacCutchan11-Sep-11 4:03 
GeneralRe: hi Pin
GANESH238911-Sep-11 6:44
GANESH238911-Sep-11 6:44 
GeneralRe: hi Pin
Richard MacCutchan11-Sep-11 7:20
mveRichard MacCutchan11-Sep-11 7:20 
GeneralRe: hi Pin
GANESH238911-Sep-11 7:27
GANESH238911-Sep-11 7:27 
AnswerRe: hi Pin
TorstenH.11-Sep-11 22:49
TorstenH.11-Sep-11 22:49 
Questionhi guys,, Pin
GANESH238911-Sep-11 3:21
GANESH238911-Sep-11 3:21 
AnswerRe: hi guys,, Pin
Simon Bang Terkildsen11-Sep-11 3:30
Simon Bang Terkildsen11-Sep-11 3:30 
GeneralRe: hi guys,, Pin
GANESH238911-Sep-11 6:47
GANESH238911-Sep-11 6:47 
GeneralRe: hi guys,, Pin
Richard MacCutchan11-Sep-11 7:22
mveRichard MacCutchan11-Sep-11 7:22 
QuestionData stores for Java Pin
oraclepilot7-Sep-11 7:03
oraclepilot7-Sep-11 7:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.