• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A question about GUI

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Shen Lin
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks very much. I fixed it.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic