Forums Register Login

A question about GUI

+Pie Number of slices to send: Send
I wrote a simple Client/Server program. It is able to send messages between two computers. Now I want to build user interface for this program. There is a "Apply" button on the interface and it will pop out a small window with two text fields for typing in socket number and server's host name. The related code and my problem is described below:

Thanks very much.
[ edited to remove big long unbroken line within code block -ds ]
[ March 17, 2003: Message edited by: Dirk Schreckmann ]
+Pie Number of slices to send: Send
I am a bit confused. You already have a gui that has an Apply button. Why is the input field not on THAT GUI? Then when you hit the Apply you would do the processing.
However, in this scenario, if this is the code in the listener for the original Apply button, and it is supposed to present a pop-up with input fileds, then the code for what to do after the text fields are filled in should not be in here.
You need to have an "OK" button or something on your pop-up dialog, and have a separate listener for THAT which holds the logic on how to handle the input values.
The important thing is that you separate the place where you create your GUI components, and the logic for what happens when your button is pressed. Don't create GUI components inside the listener logic.
[ March 17, 2003: Message edited by: Cindy Glass ]
+Pie Number of slices to send: Send
Thanks very much. I fixed it.
She'll be back. I'm just gonna wait here. With this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 729 times.
Similar Threads
Can't catch Window Close event when trying SocketServer trying to accept connections
help with interface, static counter - RMI?
problem with program
Multiple threads writing and reading from single socket
Help Client Server implementaion
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:45:39.