Creating a GUI for Ship classes

Posted 07 September 2012 - 11:06 AM

Hello there,

I am trying to complete the design of three ship classes. I think I have the classes (and their inheritance) set up properly. But now I need to create a test program that has a graphical user interface which allows the user to enter the information for a ship and includes a set of radio buttons to select the type of ship to create.

I've set up a GUI shell but after that I'm a little lost in the woods. Any input would be appreciated!

Replies To: Creating a GUI for Ship classes

Re: Creating a GUI for Ship classes

Posted 07 September 2012 - 01:25 PM

You're going to need to read up on Swing and design a form to input ship data. You will need JRadioButton, JTextField, JButton, and JLabel. Then you will want to find the LayoutManager(s) that set it up the way you want and then make an ActionListener to record the data when the button is pressed.

Re: Creating a GUI for Ship classes

Posted 08 September 2012 - 02:04 PM

So just to be clear, what I'm looking to have the GUI do is this:

1) User enters the data for each type of ship (name, year, capacity, passengers).
2) User selects the type of ship (ship, cargo or cruise) using a radio button function.
3) Then the driver displays the info for each ship created.

Really appreciate any help and time offered here. It's giving me trouble.