Write a java gui program that has eight tabs

Assignment Help JAVA Programming
Reference no: EM13891694

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: EM13891694

Questions Cloud

How much would you recommend paying the expert : How much would you recommend paying the expert? How much would the company be willing to pay for perfect information on A only?
Plan to conduct a marketing experimentin : You plan to conduct a marketing experimentin which students are to taste one of two different brands of soft drink. Theirtask is to correctly identify the brand tasted. You select a random sample of200 students and assume that the students have no ab..
Correct for heteroscedasticity : What is the value of the new intercept and the slope coefficients associated with X1 and X2? How do they compare with the corresponding values before the transformation?
Write a java gui program that has eight tabs : 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.
Determine the transfer function of the system : A causal LTIV discrete-time system is described by the difference equation: y[n] = 0.4y[n - 1] + 0.05y[n - 2] + 3x[n], where x[n] and y[n] are, respectively, the input and the output sequences of the system. Determine the transfer function H(Z) of ..
Long-term stress differentiated : How is long-term stress differentiated from short-term stress in this article? What brain region is involved in this comparison and what is its general function? Insert a labeled picture of this region into your assignment illustrating its locatio..
Write a summary paper about the given article : Write a summary paper about the article "Design, Validation and Control of Sterile Manufacturing Facilities: A Brief Overview from the Perspective of Risk Management and Existing Regulation" by Ana Quinto and Jose C. Menezes.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Develop and test stand alone java applications

Gain practical skills in Graphical User Interface (GUI) programming by implementing an event driven application.

  Implementation activities of software development

Analysis, design, and implementation activities of software development

  Sequence of method in vector class

Construct a Vector class implementing a number of vector operations as methods along with a testing program to verify the class is working.

  Draw a picture with an appearance

You must use the given Rectangle and Oval classes to draw a picture with an appearance as close as possible.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Prepare a method that takes a string as input

Prepare a method that takes a String as input and returns a String containing the middle character of the String if the length of that String is odd.

  Write a test program that creates an array

Write a test program that creates an array of ten strings, an array of ten integers, and an array of ten dates, and finds the largest string, integer, and date in the arrays.

  Write a java application that reads a file containing text

Write a Java application that reads a file containing text. Your program should read each line and display it on the console screen preceded by line numbers. If the input file is:

  Java application prompt user to put in integer from keyboard

Write a java application that performs the following task: prompt user to put in an integer from the keyboard, search for the user input from the array created in step 1.

  What is the difference between arrays and arraylist

What is the difference between arrays and ArrayList? What are the advantages and disadvantages of an ArrayList

  Write a program that ask the user to enter a usemame

Write a program usennuftevalidator.java that ask the user to enter a usemame and checks whether the usemame meets the following criteria

  Write a definition for two recursive methods

public static String filter(String s, String rem) to return a String that is the result of removing every occurrence of all of the characters in the second parameter from the first parameter. For example, filter("abcdbdabdcbddda","bd") should retu..

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