Hi trooper888 ,
Welcome to TSG !
I suggest you to start first your application by making a design of your GUI and its components.
For example :
- a resizable frame for the user (because it must be friendly) as the main container,
- a titled panel containing a set of 2 radio buttons for the wished currency (euro, pound),
- a label and a writable text box to insert the wished amount of money,
- a label and a protected text box to display the money converted in pounds,
- a label and a protected text box to display the number of gallons,
- a label and a protected text box to display the number of litres,
- a label and a protected text box to display the mileage,
- a button that will be used to compute,
- a button that will be used to reset the inputs and outputs,
- eventually a button to exit the application
After that, you build a diagram that describes the wished behaviour of your GUI (if you're familiar with UML, it is called a use case diagram).
For example :
Step 1 When the user runs the program, a frame opens. The frame is centered and sizes 2/3 of the user's screen. The frame is resizable. The X button on the right top is enabled to stop the program.
Step 2 The user has the choice of euros or pounds as the currency with a set of 2 radio buttons. Default is set to euros.
Step 3 There's a input box that allows only numeric entries including eventually a decimal point followed by 2 decimals. The user must fill the input box with the wished amount of money
...
...
... and so on
And when you're done with all that stuff, then you can think about the coding.
If you're following my example, you've at least one constructor to initialize your frame and six methods treating the events (the 2 radio buttons, the input box and the 3 buttons).
The Exit button is the more easy.
