# NEED HELP ASAP!!

• August 18th, 2010, 03:51 PM
JavaStudent_09
NEED HELP ASAP!!
I have a final project and this is the requirments of it

Notes:
1.General Tab: There will be a General Tab that will display today’s date for the users.
2. Pool: After a length, width, and depth have been entered, the user can click Enter and the program will display the calculated volume (length * width * depth in cubic feet).
3. Hot Tub: The Hot Tub tab allows for round and oval tubs’ volumes to be calculated. When Round Tub is selected, the user cannot fill out the width field since we’re dealing with a circle. After filling out the length and depth fields, the Enter button will display the volume (Pi * ((length/2)^2) * depth). The width is automatically set to the same value as the length, and the user is informed. The formula used to calculate the volume is (Pi * (length * width)^2) * depth.
4. Temperature changer- This will convert the temp from C to F.
• To convert Fahrenheit temperatures into Celsius:
o Begin by subtracting 32 from the Fahrenheit number.
o Divide the answer by 9.
o Then multiply that answer by 5
• To convert Celsius into Fahrenheit temperatures:
o Begin by multiplying the Celsius temperature by 9.
o Divide the answer by 5.
5. Manufacturer- This will be where you place the manufacturing companies name your hot tub or pool. You will be asked to input the name and then click the Enter button and it will display the manufacture name.
6. Customer- Gives you the option to place your full name and address. You will be asked to input the name, address and then click the Enter button and it will display all three in the display section.
7. Customer Comments- Gives you the option to place comment and press enter. When you press enter your message will be displayed in the display section.

This is the coding I have so far... I need a lot of help and guidance to the right direction
Code java:

```import java.awt.*; import javax.swing.*;;   public class FinalProject extends JFrame { private JLabel textPrompt; private JTextArea inputText; private JLabel keyPrompt; private JTextField inputKey; Container container;   public FinalProject() { super( "Final Project " );   JTabbedPane tab = new JTabbedPane(); // constructing the first panel   JLabel l1 = new JLabel( "Pool" ); JPanel p1 = new JPanel(); Label heightLabel = new Label ("Height:"); TextField heightField = new TextField(15); Label widthLabel = new Label ("Width:"); TextField widthField = new TextField(15); Label depthLabel = new Label ("Depth:"); TextField depthField = new TextField(15);   tab.addTab( "Pool", null, p1, " Pool" );   // constructing the second panel JLabel l2 = new JLabel("Hot Tube"); JPanel p2 = new JPanel();   //Pi * (length * width)^2) * depth   tab.addTab( "Hot Tube", null, p2, " Hot Tube" );   // constructing the third panel   JLabel l3 = new JLabel( " Temperature Change!" ); JPanel p3 = new JPanel(); tab.addTab( "Temperature Change", null, p3, " Temperature Change" );   // constructing the fourth panel   JLabel l4 = new JLabel( "Customer" ); JPanel p4 = new JPanel(); tab.addTab( "Customer", null, p4, " Customer" );   // constructing the fifth panel   JLabel l5 = new JLabel( "General" ); JPanel p5 = new JPanel(); tab.addTab( "General", null, p5, " General"); //constructing the last panel   JLabel l6 = new JLabel( "Manufacture"); JPanel p6 = new JPanel(); tab.addTab( "Manufacture", null, p6, " Manufacture" );   //constructing the Comment panel   JLabel l7= new JLabel("Customer Comments?"); JPanel p7 = new JPanel(); JPanel enterPanel = new JPanel( ); JButton enterButton = new JButton("Enter"); enterPanel.add(enterButton);     textPrompt = new JLabel("Customer Comments here please!"); inputText = new JTextArea(5, 15); inputText.setLineWrap(true); inputText.setWrapStyleWord(true);     //add components to window container = getContentPane();   //use borderlayout to position our two i/o panels container.setLayout(new BorderLayout()); p7.setLayout(new FlowLayout());   //add components to panels p7.add(textPrompt); p7.add(inputText); //add panels to our primary borderlayout add(p7, BorderLayout.NORTH);   // add JTabbedPane to container getContentPane().add( tab );   setSize( 400, 250 ); setVisible( true ); tab.addTab ("Customer Comments?",null,p7,"Customer Comments?");     } public static void main( String args[] ) { FinalProject demo = new FinalProject(); demo.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); }   }```
• August 18th, 2010, 04:30 PM
Norm
Re: NEED HELP ASAP!!
What are your questions or problems?

Please use code tags when posting code to preserve the formatting and indentations.
• August 18th, 2010, 04:38 PM
JavaStudent_09
Re: NEED HELP ASAP!!
My questions is the whole code... I know I have the tabs correctly and the customer comments correctly. I dont know how to do the volume section for the pool or hot tube section or do the general tab where it is suppose to display todays date.
• August 18th, 2010, 05:27 PM
Norm
Re: NEED HELP ASAP!!
Take them one at a time:
Quote:

how to do the volume section for the pool
Can you describe what is the problem here?
• August 18th, 2010, 05:29 PM
JavaStudent_09
Re: NEED HELP ASAP!!
The assignment is to have text areas where a customer can put in the height, width and depth of the pool and they use all of that to calculate the volume.
• August 18th, 2010, 05:39 PM
Norm
Re: NEED HELP ASAP!!
You need to design a GUI with text fields where a customer can put in the data.
Use a JPanel to hold the components.
Design how the components are to be positioned in the panel and the chose a layout manager to support that.
• August 18th, 2010, 05:55 PM
JavaStudent_09
Re: NEED HELP ASAP!!
Im still kind of confused on the format of the code? I am new to this and dont know how to do this...
• August 18th, 2010, 07:33 PM
Norm
Re: NEED HELP ASAP!!
Time to do some reading in the Tutorial about how to build GUI.