GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes adding swing component later Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "adding swing component later" Watch "adding swing component later" New topic
Author

adding swing component later

naveen yadav
Ranch Hand

Joined: Oct 23, 2011
Posts: 384

hi ranchers ,

i am facing a gui related problem . Let me explain context of the problem. I am creating a Client side GUI Swing interface for RMI based Lotto application.
The client side
i have created a JTextField which takes the user input munbers and there is JButton("OK"). And have added these components to JFrame.
when user clicks "ok" button the .numbers is send to server.
Server generate a random number and match against all input numbers.If any of number match MSG = "win" else MSG="loss". And send this message to client.

Now the problem is
how can i show up this message in GUI component on client side ?




Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10426
    
    8

Create and add JLabel instance to GUI
On getting the server input, call setText() on the label instance, to display the message


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
naveen yadav
Ranch Hand

Joined: Oct 23, 2011
Posts: 384

Maneesh Godbole wrote:Create and add JLabel instance to GUI
On getting the server input, call setText() on the label instance, to display the message


thank you
 
GeeCON Prague 2014
 
subject: adding swing component later