Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: NEED HELP ASAP!!

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question 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.
    o Now add 32
    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
    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 );
    }
     
    }
    Last edited by copeg; August 18th, 2010 at 04:54 PM. Reason: Please use the code tags


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: NEED HELP ASAP!!

    What are your questions or problems?

    Please use code tags when posting code to preserve the formatting and indentations.

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: NEED HELP ASAP!!

    Take them one at a time:
    how to do the volume section for the pool
    Can you describe what is the problem here?

  5. #5
    Junior Member
    Join Date
    Aug 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default 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.

  7. #7
    Junior Member
    Join Date
    Aug 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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...

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: NEED HELP ASAP!!

    Time to do some reading in the Tutorial about how to build GUI.
    Your code has panels, layout managers and components in it already.
    What you need to do is more of the same for the other tabs.

Similar Threads

  1. NEED HELP ASAP PLEASE!!!
    By mbm4ever in forum What's Wrong With My Code?
    Replies: 8
    Last Post: August 12th, 2010, 07:01 PM
  2. Need a calandar app done asap
    By gixmo in forum Paid Java Projects
    Replies: 6
    Last Post: July 10th, 2010, 08:58 PM
  3. Recursion Problem Need Help ASAP
    By Delstateprogramer in forum Algorithms & Recursion
    Replies: 6
    Last Post: June 26th, 2010, 08:36 PM
  4. Need simple JAVA program fixing ASAP
    By theviper in forum Paid Java Projects
    Replies: 1
    Last Post: April 14th, 2010, 10:59 AM
  5. Replies: 1
    Last Post: April 1st, 2009, 02:47 PM