Calculate button to show the pools volume in a message box.

Assignment Help Computer Graphics
Reference no: EM13950877

I need to write a java gui program that has 8 tabs, General, Options, Customers, Contractors, Pools, Hot Tubs, Temp Calc, and Length Calc. Each pane needs an Exit button that will close only that pane. The General tab needs to show the current day. The Options tab needs to have "Change Company Name:" with a text box and a button that says Set New Name. The Customers and Contractors tabs both need to allow the user to add new customers/contractors and check for the existence of the customer.txt/contract.txt file in the directory where the program is located. If the file doesn't exist, the program tells the user in the Message Area at the bottom of the pane. The user should be able to delete these as well. The Pools tab should have a text box to enter the pool's length, width and depth and then calculate button to show the pools volume in a message box.

The Hot Tubs tab will allow for round and oval tubs volumes to be calculated as in the Pools. The Temp Calc will allow the user to enter a temperature with a drop box to choose C or F and a Convert button to convert the figure into the opposite of what is chosen with a Results text box. The Length Calc allows the user to enter a figure into one text box of Millimeters, Meters, Yards, Feet, or Inches and convert this figure filling in the blank boxes. I have my tabbed pane made for each part and I don't know where to go from here?! I can't get my exit buttons to work or the date to show on the first tab. Can you get me started on this please?

import java.awt.BorderLayout;
import java.awt.Color;
import java.util.Date;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.SwingConstants;

public class JavaTabs extends JFrame
{

public JavaTabs()
{
super( "Course Project " );

JTabbedPane tab = new JTabbedPane();
// constructing the first panel
JLabel l1 = new JLabel( " ", SwingConstants.CENTER );
JPanel p1 = new JPanel();
p1.setBackground( Color.lightGray );
p1.add( l1 );
tab.addTab( "General", null, p1, " Panel #1" );
JButton exit = new JButton("Exit");

// constructing the second panel
JLabel l2 = new JLabel("Change Company Name", SwingConstants.CENTER);
JPanel p2 = new JPanel();
p2.setBackground( Color.lightGray );
p2.add( l2 );
tab.addTab( "Options", null, p2, " Panel #2" );

// constructing the third panel
JLabel l3 = new JLabel( " " );
JPanel p3 = new JPanel();
p3.setBackground( Color.lightGray );
tab.addTab( "Customers", null, p3, " Panel #3" );

// constructing the fourth panel
JLabel l4 = new JLabel( " " );
JPanel p4 = new JPanel();
p4.setBackground( Color.lightGray );
p4.add( l4 );
tab.addTab( "Contractors", null, p4, " Panel #4" );

// constructing the fifth panel
JLabel l5 = new JLabel( " " );
JPanel p5 = new JPanel();
p5.setBackground( Color.lightGray );
p5.add( l5 );
tab.addTab( "Pools", null, p5, " Panel #5" );

// constructing the sixth panel
JLabel l6 = new JLabel(" ");
JPanel p6 = new JPanel();
p6.setBackground( Color.lightGray );
p6.add(l6);
tab.addTab("Hot Tubs", null, p6, "Panel #6" );

// constructing the seventh panel
JLabel l7 = new JLabel(" ");
JPanel p7 = new JPanel();
p7.setBackground( Color.lightGray );
p7.add(l7);
tab.addTab("Temp Calc", null, p7, "Panel #7" );

// constructing the eighth panel
JLabel l8 = new JLabel(" ");
JPanel p8 = new JPanel();
p8.setBackground( Color.lightGray );
p8.add(l8);
tab.addTab("Length Calc", null, p8, "Panel #8" );

JButton test = new JButton("Exit");
p1.add(test);

// add JTabbedPane to container
getContentPane().add( tab );

setSize( 350, 300 );
setLocation(300, 250);
setVisible( true );
}

public static void main( String args[] )
{
{
JavaTabs tabs = new JavaTabs();
tabs.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
}
}
}

Reference no: EM13950877

Questions Cloud

It is impossible to have an apr quoted for deposit accounts : It is impossible to have an APR quoted for deposit accounts? Or, better yet, is it impossible to have an EAR calculated for loans?
How much is the company behind in preferred dividends : National Health Corporation (NHC) has a cumulative preferred stock issue outstanding, which has a stated annual dividend of $8 per share. The company has been losing money and has not paid preferred dividends for the last five years. How much is the ..
Problem regarding the incompetent management : Henry Manne believed that companies cannot become too incompetent or corrupt, as eventually their share price would fall and they could be taken over by another firm that would get rid of incompetent management. Adolf Berle and Gardiner Means beli..
Extract compound of interest from tlc : I want to extract compound of interest from TLC. I am finding some enzyme inhbitor from microbial source can you plzz suggest me how to prepare nad get my compound.
Calculate button to show the pools volume in a message box. : The Hot Tubs tab will allow for round and oval tubs volumes to be calculated as in the Pools. The Temp Calc will allow the user to enter a temperature with a drop box to choose C or F and a Convert button to convert the figure into the opposite of..
The planned purchase of the house assets : Rocco and Stella Thompson are in their 20s and are just about to make one of the most important commitments of their lives is buying a home and starting a family. They have been living in a small apartment in Denver, since their marriage and college ..
What is probability that the passenger is using airport a : Suppose that, in a particular city, airport A handles 50% of all airline traffic, and airports B and C handle 30% and 20%, respectively. The detection rates for weapons at the three airports are .9, .5, and .4, respectively. If a passenger at one ..
Employment contract with computers : In March 2011 Chu, at age 50, decides to retire. As part of his employment contract with Computers Pty Ltd, Chu had agreed that he will not compete against the company in New South Wales for two years.
What is the amount of the cash flow to creditors : At the beginning of the year, the long-term debt of a firm was 300 and total debt was 350. At the end of the year, long-term debt was 250 and total debt was 360. The interest paid was 32. What is the amount of the cash flow to creditors?

Reviews

Write a Review

Computer Graphics Questions & Answers

  Create a basic web page

It is critical that you keep your Web site material organized and easy to use. By having a file structure that is easy to use, you will be able to place material in the appropriate folder and have it available when it is needed.

  Frequency distribution of categorical data

Frequency Distribution of Categorical Data

  Ljfkdjfk sdkfj ksdjkfjsdk j sd fldsl klsdl lsdlfkldsk

sd fldsl klsdl lsdlfkldsk lksldkflksdlfklksdl lsdklf l sd fldsl klsdl lsdlfkldsk lksldkflksdlfklksdl lsdklf l sd fldsl

  Draw a custom two-dimensional graphics

Draw a custom two-dimensional graphics (artwork) of your own choices by combining at least four Shape classes and neatly organizing them in any layout container. Paint and transform your graphics by using any gradient Brush with more than two colo..

  Find the normal to the triangle

Find the normal to the triangle. Assume that the triangle is given clockwise. Normalize the vector. Draw a figure showing that your normal is correct.

  Bullhow might the application of risks management to

bullhow might the application of risks management to possible options be applied to establishing objectives and

  Retieving a value using d["susan"]?

Suppose d = {"john":40, "peter":45}, what happens when retieving a value using d["susan"]?

  Media effects theories

Mass Media EffectsThe study of mass media effects has a long and storied history that predates the existence of the communication discipline itself. Yet, its breadth and scope have made it challenging for the area to gain coherence.

  Organized to focus more on organizational

As you probably have noted, this course is organized to focus more on organizational and enterprise level issues than on individual or group behavior. There are other courses in the program that allow you the opportunity to reflect on lower le..

  Load a color image as a variable imc

Load a color image as a variable ImC - Create a function named rgb26cc to convert each pixel to corresponding 6-bit color code

  Create menu or appropriate gui for material parameters

Create menu or appropriate GUI for material parameters. Users should be able to manipulate the parameters for material; ambient, diffuse, specular in each RGB channel and shininess.

  Build agraphical user interface for a text editor

Using BlueJ, Design and build aGraphical user interface for a text editor. Users should be able to enter text,edit, scroll, etc. Consider functions for formatting (font faces, style, andsize) and a character/word-count function.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd