Java Final Project Error

Java Final Project Error

It isnt showing the result when I press the proper button...?? It isnt doing the work... can someone help me??

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.text.SimpleDateFormat;
import java.util.Date;
public class FinalProject extends JFrame implements ActionListener
{
JLabel textPrompt;
JTextArea inputText;
JLabel keyPrompt;
JTextField inputKey;
Container container;

public FinalProject()
{
super( "Final Project " );
JTabbedPane tab = new JTabbedPane();

// constructing the Pool Panel

JPanel p1 = new JPanel();
JLabel label4,label5,lable6;
final JTextField text4,text5,text6,text13;
label4 = new JLabel();
label4.setText("Height:");
p1.add(label4);
text4 = new JTextField(20);
p1.add(text4);
JLabel space3 = new JLabel(" ");
p1.add(space3);
label5 = new JLabel();
label5.setText("Width:");
p1.add (label5);
text5 = new JTextField(20);
p1.add(text5);
JLabel space5 = new JLabel(" ");
p1.add(space5);
lable6 = new JLabel();
lable6.setText("Depth:");
p1.add(lable6);
text6 = new JTextField(20);
p1.add(text6);
JLabel space2 = new JLabel(" ");
p1.add(space2);
JButton button = new JButton("Enter");
p1.add(button);
tab.addTab( "Pool", null, p1, " Pool" );
text13 = new JTextField();
p1.add(text13);
button.addActionListener(this);

new ActionListener(){
public void actionPerformed(ActionEvent e) {
e.getActionCommand();
int length=Integer.parseInt(text4.getText());
int width=Integer.parseInt(text5.getText());
int depth=Integer.parseInt(text6.getText());

if (e.getActionCommand().equals("Enter")) {
int volume = ((length * width) * depth);
JOptionPane.showMessageDialog(null, "The Volume is:"+volume,"for your pool.", JOptionPane.INFORMATION_MESSAGE);
}
}
};
// constructing the Hot Tube panel

new JLabel("Hot Tube");
JPanel p2 = new JPanel();
JLabel label7,label8,lable9;
final JTextField text7,text8,text9;{
label7 = new JLabel();
label7.setText("Height:");
p2.add(label7);
text7 = new JTextField(20);
p2.add(text7);
JLabel space6 = new JLabel(" ");
p2.add(space6);
label8 = new JLabel();
label8.setText("Width:");
p2.add(label8);
text8 = new JTextField(20);
p2.add(text8);
JLabel space7 = new JLabel(" ");
p2.add(space7);
lable9 = new JLabel();
lable9.setText("Depth:");
p2.add(lable9);
text9 = new JTextField(20);
p2.add(text9);
JLabel space8 = new JLabel(" ");
p2.add(space8);
JButton rbutton = new JButton("Oval");
p2.add(rbutton);
JButton rbutton1 = new JButton ("Round");
p2.add(rbutton1);

tab.addTab( "Hot Tube", null, p2, " Hot Tube" );
rbutton.addActionListener(this);
rbutton1.addActionListener(this);

new ActionListener(){
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub

int length=Integer.parseInt(text7.getText());
int width=Integer.parseInt(text8.getText());
int depth=Integer.parseInt(text9.getText());

if(e.getActionCommand().equals("Oval")){
int volume = ((length * width) * depth);
JOptionPane.showMessageDialog(null, "The Volume is:"+volume,"" +
"for your oval hot tube.", JOptionPane.INFORMATION_MESSAGE);
}
else if(e.getActionCommand().equals("Round")){
int volume1= (((length/2)^2) * depth);
JOptionPane.showMessageDialog(null, "The Volume is:"+volume1,"" +
"for your round hot tube.", JOptionPane.INFORMATION_MESSAGE);
}
}
};
// constructing the Temperature Change panel

new JLabel( " Temperature Change!" );
JPanel p3 = new JPanel();
JLabel label10;
final JTextField text10;
label10 = new JLabel();
label10.setText("Temperature:");
p3.add(label10);
text10 = new JTextField(20);
p3.add(text10);
JButton button3 = new JButton("Enter");
p3.add(button3);
JCheckBox boxF = new JCheckBox("F");
p3.add(boxF);
JCheckBox boxC = new JCheckBox("C");
p3.add(boxC);
tab.addTab( "Temperature Change", null, p3, " Temperature Change" );
button3.addActionListener(this);
boxF.addActionListener(this);
boxC.addActionListener(this);

new ActionListener(){
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
int temperature=Integer.parseInt(text10.getText());

if(e.getActionCommand().equals("C")){
int temp = (( temperature* 9)/5+32);
JOptionPane.showMessageDialog(null, "The Celcuis temperature is changed to:"
+temp,"" +
"in fahrenheit", JOptionPane.INFORMATION_MESSAGE);
}
else if(e.getActionCommand().equals("F")){
int temp1= (((temperature - 32)/9)*5);
JOptionPane.showMessageDialog(null, "The farhrenheight temperature is changed to:"+temp1,""+
"in Celcius.", JOptionPane.INFORMATION_MESSAGE);
}
}
};
// constructing the Customer panel

JPanel p4 = new JPanel();
JLabel label1,label2;
final JTextField text1,text2;
label1 = new JLabel();
label1.setText("Name:");
p4.add(label1);
text1 = new JTextField(20);
p4.add(text1);
JLabel space = new JLabel(" ");//MDB
p4.add(space);
label2 = new JLabel();
label2.setText("Address:");
p4.add(label2);
text2 = new JTextField(20);
p4.add(text2);
JButton button4 = new JButton("Enter");
p4.add(button4);
tab.addTab( "Customer", null, p4, " Customer" );
button4.setActionCommand ("Enter");

new ActionListener(){
public void actionPerformed(ActionEvent e) {
e.getActionCommand();
int Name=Integer.parseInt(text1.getText()) ;
int Address=Integer.parseInt(text2.getText());
if (e.getActionCommand().equals("Enter")) {
JOptionPane.showMessageDialog(null, "Customer's name is:"+Name,"Their address is:"
+Address, JOptionPane.INFORMATION_MESSAGE);
}
}
};
// constructing the General panel

new JLabel( "General" );
JPanel p5 = new JPanel();
Date date = new Date();
SimpleDateFormat dateformatMMDDYYYY = new SimpleDateFormat("MM/dd/yyyy");
new StringBuilder( dateformatMMDDYYYY.format( date ) );
JLabel space11 = new JLabel(" ");
p5.add(space11);
JLabel space12 = new JLabel(" ");
p5.add(space12);
JLabel space13 = new JLabel(" ");
p5.add(space13);
JLabel label11;
label11 = new JLabel();
label11.setText("Today's Date is:");
p5.add(label11);
JLabel texta1;
texta1 = new JLabel();
texta1.setText(dateformatMMDDYYYY.format(date));
p5.add(texta1);
tab.addTab( "General", null, p5, " Today's Date");

//constructing the Manufacture panel

JPanel p6 = new JPanel();
JLabel label3;
final JTextField text3;
label3 = new JLabel();
label3.setText("Manufacture:");
p6.add(label3);
text3 = new JTextField(20);
p6.add(text3);
JLabel space1 = new JLabel(" ");
p6.add(space1);
tab.addTab( "Manufacture", null, p6, " Manufacture" );
JButton button6 = new JButton("Enter");
p6.add(button6);
button6.addActionListener(this);
{
button6.setActionCommand ("Enter");

new ActionListener(){
public void actionPerformed(ActionEvent e) {
e.getActionCommand();
int Manufacture=Integer.parseInt(text3.getText()) ;

if (e.getActionCommand().equals("Enter")) {
JOptionPane.showMessageDialog(null, "Manufacture's name is:"
+Manufacture,"", JOptionPane.INFORMATION_MESSAGE);
}
}
};
//constructing the Comment panel

new JLabel("Customer Comments?");
JPanel p7 = new JPanel();
new JPanel( );
textPrompt = new JLabel("Customer comments:");
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 );
JButton button7 = new JButton("Enter");
p7.add(button7);
tab.addTab ("Customer Comments?",null,p7,"Customer Comments?");
button7.addActionListener(this);}

new ActionListener(){
public void actionPerformed(ActionEvent e) {
e.getActionCommand();
int Comments=Integer.parseInt(inputText.getText()) ;

if (e.getActionCommand().equals("Enter")) {
JOptionPane.showMessageDialog(null, "Customer's comment:"+Comments,"", JOptionPane.INFORMATION_MESSAGE);
}
}

};
}
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}

public static void main( String args[] )
{
FinalProject demo = new FinalProject();
demo.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
}
}
View Answers









Related Tutorials/Questions & Answers:
Java Final Project Error - Java Beginners
Java Final Project Error  It isnt showing the result when I press... inputKey; Container container; public FinalProject() { super( "Final Project " ); JTabbedPane tab = new JTabbedPane(); // constructing the Pool
Final Project - Java Beginners
, but it is suggested that you begin working on the final project assignment in Week 5, which...Final Project  The importance of a graphical user interface in programming is paramount in being successful in the business industry. This project
Advertisements
Final Project II - Java Beginners
Final Project II  Is there anyway I can get the project back by Saturday??? It is due on Sunday by midnight...Thank You
Java Final Project - Java Beginners
Java Final Project  I am having a real hard time with this java... final project. This is your opportunity to show off your skills! Overall...() { super( "Final Project " ); JTabbedPane tab = new JTabbedPane(); // constructing
ModuleNotFoundError: No module named 'Final_Project'
'Final_Project' error? Thanks   Hi, In your python...;Final_Project' error will be solved. Thanks...ModuleNotFoundError: No module named 'Final_Project'  Hi, My
final year project on artificial intelligence
final year project on artificial intelligence  Hi, I am beginner... to learn: final year project on artificial intelligence Try to provide me good examples or tutorials links so that I can learn the topic "final year
final year project artificial intelligence
final year project artificial intelligence  Hi, I am beginner... to learn: final year project artificial intelligence Try to provide me good examples or tutorials links so that I can learn the topic "final year project
machine learning final year project
: machine learning final year project Try to provide me good examples or tutorials links so that I can learn the topic "machine learning final year...machine learning final year project  Hi, I am beginner in Data
Java Final Variable
Java Final Variable  I have some confusion --Final variable has single copy for each object so can we access final variable through class name,or it is necessary to create object for accessing final variable
Final method in java
Final method in java In this section we will learn about Final method in java... time error because final class cannot be inherited.ADS_TO_REPLACE_1 Final method... void display() // Error Final method cannot be overridden
Java final keyword
Java final keyword The final is a very important keyword in java, which... with the name "Final" in a Java program. We can have final methods, final... Exampleof final jeyword in Java: public class FinalExample
Java final
Java final       In the Java programming language, the keyword "final" is used with different entity which makes it unchangeable later. We can have final methods, final
final
final  what does final means in "public static final void main (string args[])" ?   keyword final can be assigned only once. They cannot be modified
Java final Keyword Example
Java final Keyword Example In this section we will read about the final keyword in Java in various context. final keyword in Java can be used... the final keyword can be used in Java applies its main integrity i.e.
Final Methods - Java Tutorials
The final Keyword in Java In Java, final keyword is applied in various context. The final keyword is a modifier means the final class can't be extended.... final classes The class declared as final can't be subclass or extend
private and final - Java Interview Questions
and final modifier in java   Hi Friend, Private modifier indicates... be accessed or instantiated outside. Final modifier indicates.... They cannot be overriden by subclasses. The final class can't be extended
Final Key Word in Java
.style1 { text-align: center; } Final key word in java In java final is a key word used in several different contexts. It is used before... is a final variable introduced in java 1.1, its declaration lacks
Static final variables - Java Beginners
Static final variables  can a static final variable be accessed by a instance (non-static)method?  Hi, static final variable u can... Xyz{ private static final String name="xyz"; public void displayData
Java final method
;); } } Resource:ADS_TO_REPLACE_2 Final Methods - Java Tutorials Final method in java Java final Keyword Example Java final...final keyword when used with method results in final method, which cannot
TYBsc IT final project (MOBILE BASED SMS SEARCH ENGIN)
TYBsc IT final project (MOBILE BASED SMS SEARCH ENGIN)  How to send sms pc to mobile using JSP & Servelet
TYBsc IT final project (MOBILE BASED SMS SEARCH ENGIN)
TYBsc IT final project (MOBILE BASED SMS SEARCH ENGIN)  How to send... modem? Pls give me fast reply becoz my porject(TYBsc IT)final has not been completed. so i requested to you pls answer my question. My project name is MOBILE
Java method final parameter
Java method final parameter       Example below demonstrates the working of java final keyword... set to final. This means double type radius is no more a variable
final keyword
final keyword  why is final keyword used in java
Java Error in Bus Time Table Project - Development process
Java Error in Bus Time Table Project  Please Solve Errors import...*; import java.sql.*; import java.util.*; class Project{ JFrame f; JPanel...; GridBagConstraints gbc; Project(){ f=new JFrame("Bus TimeTable"); p=new JPanel(); p1
Can you give few examples of final classes defined in Java API?
Can you give few examples of final classes defined in Java API?   Hi, Can you give few examples of final classes defined in Java API? thanks
Java error
Java error  class WhileLoopMethod{ public static void main(String args[]){ new Hello(); } } class Hello{ int a = 5, b = 88; while(a } //it is giving compile time error .....illegal start
Java error
Java error  class WhileLoopMethod{ public static void main(String args[]){ new Hello(); } } class Hello{ int a = 5, b = 88; while(a } //it is giving compile time error .....illegal start
I GOT ERROR FOR MY PROJECT
I GOT ERROR FOR MY PROJECT  Dear Friend/ RoseIndia Team, Firstly I would to thank u Guys help me so many time.. I got error on my little project when running at server. please correctly my error Guys... ERROR CODE: "LOGIN
Final Keyword
Final Keyword  hello, What is final?   hiiADS_TO_REPLACE_1 In case of class if we use final then this class can not be extended or final class may not be subclassed. A final method can't be overridden when its class
final variable
final variable  Please give some easiest and understanding example program for final variable
final grade
final grade  C. Write a JavaScript program that would input a student?s final grade from 50-100. Evaluate the Final grade and display the Point...?s final grade from 50-100. Evaluate the Final grade and display the Point
java compilation error - Java Beginners
java compilation error  here is the rest of my codes. I hope you... information private final JLabel nameLabel = new JLabel( "Product Name: "); private JTextField nameText; private final JLabel numberLabel = new JLabel
Error in Shopping Cart project - Development process
Error in Shopping Cart project  I tried running the shopping cart project given in the below link: http://www.roseindia.net/shoppingcart... when I submit "http://localhost:8080/cart" I received the following error
The final Keyword
are always implicitly final in Java, since they cannot be overridden... The final Keyword       The final is a keyword. This is similar to const keyword in other
Grid World project Run Error !! help please!!
Grid World project Run Error !! help please!!  i'm trying to make...); } } } } and Here is my error...: (it runs at first but when the bug hits a side, the error occurs and i exit the error but run does not work anymore) (adsbygoogle
Im getting this error while running JPA project
Im getting this error while running JPA project  Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: examplePersistenceUnit] Unable to configure EntityManagerFactory
Java Error - Java Beginners
Java Error  Hello Sir ,How i Can solve Following Error Can not find Symbol - in.readLine(); Here Error Display at in  Hi Friend, It seems that you haven't defined the object 'in'.Anyways, Send your code so that we
runtime error in java
runtime error in java  What is Run time error in Java?   Run time error is a syntax error that during the execution of a program.It hash different types of a program like as Logic error,Fatal Errors,source code,wrong
PHP Final Keyword
Final Keyword in PHP: If you are familiar with Java then you must know...: Fatal error: Cannot override final method A::disp() in C:\xampp\htdocs\PHP...;ADS_TO_REPLACE_12 Output: Fatal error: Class B may not inherit from final
pointer error java
pointer error java  How to catch null pointer errors in java if the if(value != null) or null
java error - Java Beginners
java error  Hello sir, on compiling any program from command prompt.... But if I want to run that program the fetches me the following error. For example for file: Test.java C:\Program Files\Java\jdk1.6.0_17\bin>javac Test.java
java error - Java Beginners
java error  G:\threading>javac threadmethods.java Note: threadmethods.java uses or overrides a deprecated API. Note: Recompile with -Xlint... been obsoleted. To get the details of your error, compile your class with Xlint
db error - Java Beginners
("Enter Description:"); JButton ADD=new JButton("Insert"); final JTextArea area =new JTextArea(10,25); final JPanel panel=new JPanel(new
java compilation error - Applet
java compilation error  I am getting compilation error in the following code.: public void paint(Graphics g) { switch(screen...; } } Error is: Illegal start of expression Plz. find why am I getting this error
Java Error - Java Beginners
Java Error  E:\SUSHANT\Core Java\FileHandling\Error>javac... ch= reader.read(); ^ 1 error import java.io....); //System.out.println("Enter characters, 'q' to quit."); try
Java Error - Java Beginners
Java Error  Here Error near Read Method import java.util.*; import java.io.*; public class inputdemo { public static void main(String[] args) throws IOException { String bookname,author; float price; System.out.println
java runtime error - JDBC
, the above exception will occur. Check, Project Properties | Build | Java... a compatible JDK. Also check, Project Properties | Build | Java | Language...java runtime error  when i am running my jdbc program using thin
JAVA Annotation Error
JAVA Annotation Error  while compiling simple java program i get annotation error i.e class will only be accepted if annotation processing is explicitly requested..how to solve
java runtime error - JDBC
java runtime error  when i m running my program by using jdk1.6.0 then it is giving the error of classunsupported major.minor version 50.0.to remove... version error 49.0.so, please suggest how will i compensate this problem
java error - Java Beginners
java error  Thanks for providing me the answer for the question... be dereferenced If Programme saved in SortFileData also shows some error Please rectify the errors and provide the coding that run properly Write a Java program

Ads