Re: Gui Question




"IanH" <hill_ian_j@xxxxxxxxxxx> wrote in message
news:1143629256.947153.275010@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi

I have to create a gui interface for employees to calculate their
salaries. I have five separate classes. I can create the gui myself
and have been given the other five classes. Now i need to link them
but not sure how to do so. Is it through action listener and event
handlers? Or is there anywhere i could see an example

It's very hard to suggest anything specific since you haven't given us any
idea what your five existing classes do beyond saying that they have
_something_ to do with employee salaries.

However, as a broad generalization - that may not be valid in your
situation - I would say that most programs using a GUI construct the GUI
very early on in the life of the program, then let the user initiate various
actions via buttons, menus or other controls in the GUI. Listeners and/or
event handlers will be attached to the GUI components and then initiate the
appropriate activities for responding to each GUI component.

I would suggest that you begin by reading through the examples that are
linked into this page of the Java Tutorial to get a good general overview of
how GUIs are constructed:
http://java.sun.com/docs/books/tutorial/uiswing/learn/index.html.

Then, if you want to explore particular components, go to
http://java.sun.com/docs/books/tutorial/uiswing/components/components.html
and click on the graphic for the GUI component(s) that you want to use to
see how to use it. In each case, you will be taken to a topic that explores
that control and how to use it via one or more small but useful examples.
The key lines of the source code for each example are explained in the topic
and links are provided so that you can run the example and see/download the
entire source code.

--
Rhino


.


Quantcast