Use of Objects, Classes and GUI components
Instructions
Create an application that will calculate a persons weight on any planet in our solar system. (even through Pluto is not longer officially a planet, we will consider it one for this lab)
The information needed to calculate the weight is included in the file Planets.txt. The information in this file includes the names of the nine planets and the planets gravity as a percentage of Earth's gravity. To find a persons weight you only need to multiple their weight by the "percentage of earth weight" number in the planets.txt file. The persons weight should be accepted through a JTextField component and their calculated weight should be displayed in a JTextArea component. The user should be able to choose the planet they would like to see their weight for from a JComboBox. If a planet is selected in the JComboBox but no weight has been entered then a message dialog box should be displayed telling the user that their earth weight is require. The user should be able to trigger the weight calculation by either selecting a planet from the JComboBox or pressing enter in the JTextField.
Also, a picture of the selected planet should be displayed whenever a planet is selected from the JComboBox. The pictures of the planets can also be downloaded. To display the planet images you should use an ImagePanel object (we will create one in class). Earth should be the default picture as well as the default option in the JComboBox.
If the planet selected by the user is Pluto you should display a message in the JTextArea saying that there is not enough information available about Pluto to calculate their weight.
Example: