This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes how to solve this problem ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to solve this problem ?" Watch "how to solve this problem ?" New topic
Author

how to solve this problem ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

what i want to do is
i have a class that listens to the server to receive a data ....and when the data arrives it append it to the textarea ..ok fine till now
what i want to do is establish a key event with both the client & server so that when ever server start pressing a key a event should fire
that event code has a function to retrieve a username of the underlying os and send to the server the server will receive it and print it on a label and make that label visible
but , the big question here is how the server will know that this is just a key event not the message so i need to set this at the label not at the text area and vise versa ?
any suggestions ???


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7696
    
  20

naved momin wrote:any suggestions ???

Yes, back up and explain what you want to do, not how you're going to do it. Your current idea sounds awfully "busy" to me, but I'm no GUI expert.
I'm also not quite sure what you mean by a "server" in this case. Is this data transmission that's going to be listening over a socket? Or are you just talking about the JVM that's (presumably) running your Swing code?

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
naved momin wrote:the big question here is how the server will know that this is just a key event not the message so i need to set this at the label not at the text area and vise versa ?
any suggestions ???


Provide separate methods for key event and other message events. How does that sound?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to solve this problem ?