Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-13-2008, 07:53 AM
Member
 
Join Date: May 2008
Posts: 20
crazydeo is on a distinguished road
[SOLVED] Please help with output!!!
Please help me out with my code. This is my code. In my output only the Quantity ordered is displaying. Everything else is all 0's.

Thank you in advance.


Code:
import java.text.DecimalFormat; import javax.swing.*; import java.awt.Color; import java.awt.Font; import java.awt.event.*; public class Main extends JFrame implements ActionListener { // All the GUI objects JPanel mainPanel = new JPanel(); JLabel storeLabel = new JLabel(" OrderBook INC. "); JTextField bookNameTextField = new JTextField(20); JTextField quantityTextField = new JTextField(20); JTextField priceTextField = new JTextField(20); JButton calculateButton = new JButton(" Calculate "); JTextArea outputTextArea = new JTextArea("Books Ordered", 10, 25); JScrollPane outputScrollPane = new JScrollPane(outputTextArea); int quantityInteger; double priceDouble; String nameString; //object of the font Font storeFont = new Font("Arial",Font.BOLD,14); public static void main(String[] args) { Main myBooks = new Main(); myBooks.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public Main() { designFrame(); } public void designFrame() { //set the font and the color storeLabel.setFont(storeFont); storeLabel.setForeground(Color.GRAY); //add the components to the mainPanel mainPanel.add(storeLabel); mainPanel.add(new JLabel(" Book Name ")); mainPanel.add(bookNameTextField); mainPanel.add(new JLabel(" Quantity Ordered ")); mainPanel.add(quantityTextField); mainPanel.add(new JLabel(" Price ")); mainPanel.add(priceTextField); mainPanel.add(calculateButton); mainPanel.add(outputScrollPane); //add the listeners priceTextField.addActionListener(this); calculateButton.addActionListener(this); //add the panel to the frame add(mainPanel); setSize(300,400); setVisible(true); } public void actionPerformed(ActionEvent evt) { getInput(); clear(); } public void getInput() { nameString = bookNameTextField.getText(); quantityInteger = Integer.parseInt(quantityTextField.getText()); priceDouble = Double.parseDouble(priceTextField.getText()); Calculation myCalcs = new Calculation(quantityInteger, priceDouble); displayOutput(myCalcs.getQuantity()); } public void displayOutput(double CalculationDouble) { Calculation myOrder = new Calculation(); //object to format to currency DecimalFormat formatDecimalFormat = new DecimalFormat("$0.00"); DecimalFormat formatNumberFormat = new DecimalFormat("0"); //variables to store the retrieved values from the calculation class double priceDouble, subTotalDouble, shippingDouble, taxDouble, totalDouble, grandTotalDouble; int totalNumberOfOrdersInteger; priceDouble = myOrder.getPrice(); subTotalDouble = myOrder.getSubTotal(); shippingDouble = myOrder.getShipping(); taxDouble = myOrder.getTax(); totalDouble = myOrder.getTotal(); grandTotalDouble = myOrder.getGrandTotal(); totalNumberOfOrdersInteger = myOrder.getNumberOfOrders(); //display output outputTextArea.append('\n' + "Name of the Book: " + nameString + '\n' + "Quantity Ordered: " + formatNumberFormat.format(quantityInteger) + '\n' + "Price: " + formatDecimalFormat.format(priceDouble)+ '\n' + '\n' + "Subtotal: " + formatDecimalFormat.format(subTotalDouble) + '\n' + "Shipping: " + formatDecimalFormat.format(shippingDouble) + '\n' + "Tax: " + formatDecimalFormat.format(taxDouble) + '\n'+ "Total: " + formatDecimalFormat.format(totalDouble) + '\n' +'\n' + "Total Quantity To-Date: " + totalNumberOfOrdersInteger + '\n' + " Grand Total To-Date: " + formatDecimalFormat.format(grandTotalDouble) + '\n'); } public void clear() { //clear existing text from text fields and request cursor to top bookNameTextField.setText(""); quantityTextField.setText(""); priceTextField.setText(""); bookNameTextField.requestFocus(); } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-13-2008, 09:46 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
Please post the Calculation() class
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-13-2008, 10:13 AM
Member
 
Join Date: May 2008
Posts: 20
crazydeo is on a distinguished road
Here you go!!

Code:
public class Calculation { private double priceDouble, subTotalDouble, taxDouble, shippingDouble, totalDouble; private int quantityInteger; private static double grandTotalDouble; private static int totalNumberOfOrdersInteger; public Calculation() { } public Calculation(int quantityNewInteger, double priceNewDouble) { setQuantity(quantityNewInteger); setPrice(priceNewDouble); calculate(); } private void setQuantity(int quantityNewInteger) { //assign public variable to private quantityInteger = quantityNewInteger; } private void setPrice(double priceNewDouble) { //assign public variable to private priceDouble = priceNewDouble; } private void calculate() { final int SHIPPING_RATE_INTEGER = 1; final double TAX_RATE_DOUBLE = 0.0825; //calculate the subTotal of the order subTotalDouble = quantityInteger * priceDouble; //calculate the shipping of the order shippingDouble = SHIPPING_RATE_INTEGER * quantityInteger; //calculate the Tax of the order taxDouble = subTotalDouble * TAX_RATE_DOUBLE; //calculate the Total including shipping and tax of the order totalDouble = taxDouble + subTotalDouble + shippingDouble; // calculate the total of all orders //and the number of orders processed grandTotalDouble += totalDouble; totalNumberOfOrdersInteger++; } public double getQuantity() { //returning quantity return quantityInteger; } public double getPrice() { //returning price return priceDouble; } public double getSubTotal() { //returning subTotal return subTotalDouble; } public double getShipping() { //returning shipping return shippingDouble; } public double getTax() { //returning Tax return taxDouble; } public double getTotal() { //returning grand total of orders return totalDouble; } public double getGrandTotal() { //returning grand total of orders return grandTotalDouble; } public int getNumberOfOrders() { //return total number of orders processed return totalNumberOfOrdersInteger; } }
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-13-2008, 10:50 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
here it is. I didnt change anything in your Calculation Class. I only modify the main class.

Code:
import java.text.DecimalFormat; import javax.swing.*; import java.awt.Color; import java.awt.Font; import java.awt.event.*; public class Main extends JFrame implements ActionListener { private Calculation myOrder = new Calculation(); // All the GUI objects JPanel mainPanel = new JPanel(); JLabel storeLabel = new JLabel(" OrderBook INC. "); JTextField bookNameTextField = new JTextField(20); JTextField quantityTextField = new JTextField(20); JTextField priceTextField = new JTextField(20); JButton calculateButton = new JButton(" Calculate "); JTextArea outputTextArea = new JTextArea("Books Ordered", 10, 25); JScrollPane outputScrollPane = new JScrollPane(outputTextArea); int quantityInteger; double priceDouble; String nameString; //object of the font Font storeFont = new Font("Arial",Font.BOLD,14); public static void main(String[] args) { Main myBooks = new Main(); myBooks.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public Main() { designFrame(); } public void designFrame() { //set the font and the color storeLabel.setFont(storeFont); storeLabel.setForeground(Color.GRAY); //add the listeners // priceTextField.addActionListener(this); calculateButton.addActionListener(this); //add the components to the mainPanel mainPanel.add(storeLabel); mainPanel.add(new JLabel(" Book Name ")); mainPanel.add(bookNameTextField); mainPanel.add(new JLabel(" Quantity Ordered ")); mainPanel.add(quantityTextField); mainPanel.add(new JLabel(" Price ")); mainPanel.add(priceTextField); mainPanel.add(calculateButton); mainPanel.add(outputScrollPane); //add the panel to the frame add(mainPanel); setSize(300,400); setVisible(true); } public void actionPerformed(ActionEvent evt) { String cmd = evt.getActionCommand(); if (cmd.equalsIgnoreCase(" Calculate ")){ nameString = bookNameTextField.getText(); quantityInteger = Integer.parseInt(quantityTextField.getText()); priceDouble = Double.parseDouble(priceTextField.getText()); myOrder.Calculation(quantityInteger, priceDouble); displayOutput(); } clear(); } public void displayOutput() { //object to format to currency DecimalFormat formatDecimalFormat = new DecimalFormat("$0.00"); DecimalFormat formatNumberFormat = new DecimalFormat("0"); //variables to store the retrieved values from the calculation class double priceDouble, subTotalDouble, shippingDouble, taxDouble, totalDouble, grandTotalDouble; int totalNumberOfOrdersInteger; priceDouble = myOrder.getPrice(); System.out.println(priceDouble); subTotalDouble = myOrder.getSubTotal(); shippingDouble = myOrder.getShipping(); taxDouble = myOrder.getTax(); totalDouble = myOrder.getTotal(); grandTotalDouble = myOrder.getGrandTotal(); totalNumberOfOrdersInteger = myOrder.getNumberOfOrders(); //display output outputTextArea.append('\n' + "Name of the Book: " + nameString + '\n' + "Quantity Ordered: " + formatNumberFormat.format(quantityInteger) + '\n' + "Price: " + formatDecimalFormat.format(priceDouble)+ '\n' + '\n' + "Subtotal: " + formatDecimalFormat.format(subTotalDouble) + '\n' + "Shipping: " + formatDecimalFormat.format(shippingDouble) + '\n' + "Tax: " + formatDecimalFormat.format(taxDouble) + '\n'+ "Total: " + formatDecimalFormat.format(totalDouble) + '\n' +'\n' + "Total Quantity To-Date: " + totalNumberOfOrdersInteger + '\n' + " Grand Total To-Date: " + formatDecimalFormat.format(grandTotalDouble) + '\n'); return; } public void clear() { //clear existing text from text fields and request cursor to top bookNameTextField.setText(""); quantityTextField.setText(""); priceTextField.setText(""); bookNameTextField.requestFocus(); } }
I hope that helps. -Eku
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-13-2008, 11:02 AM
Member
 
Join Date: May 2008
Posts: 20
crazydeo is on a distinguished road
Thanks, but I cannot use an if statement for this project.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-13-2008, 11:04 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,042
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Is that a restriction? I wonder why you can't use if conditional statement.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on September 4, 2008)

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 05-13-2008, 11:08 AM
Member
 
Join Date: May 2008
Posts: 20
crazydeo is on a distinguished road
It's a requirement for the project. I guess there is a more simpler way to do it. I just can't seem to think of it.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 05-13-2008, 11:09 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
Here you go. No more If statement.

Code:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package test; import java.text.DecimalFormat; import javax.swing.*; import java.awt.Color; import java.awt.Font; import java.awt.event.*; public class Main extends JFrame implements ActionListener { private Calculation myOrder = new Calculation(); // All the GUI objects JPanel mainPanel = new JPanel(); JLabel storeLabel = new JLabel(" OrderBook INC. "); JTextField bookNameTextField = new JTextField(20); JTextField quantityTextField = new JTextField(20); JTextField priceTextField = new JTextField(20); JButton calculateButton = new JButton(" Calculate "); JTextArea outputTextArea = new JTextArea("Books Ordered", 10, 25); JScrollPane outputScrollPane = new JScrollPane(outputTextArea); int quantityInteger; double priceDouble; String nameString; //object of the font Font storeFont = new Font("Arial",Font.BOLD,14); public static void main(String[] args) { Main myBooks = new Main(); myBooks.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public Main() { designFrame(); } public void designFrame() { //set the font and the color storeLabel.setFont(storeFont); storeLabel.setForeground(Color.GRAY); //add the listeners calculateButton.addActionListener(this); //add the components to the mainPanel mainPanel.add(storeLabel); mainPanel.add(new JLabel(" Book Name ")); mainPanel.add(bookNameTextField); mainPanel.add(new JLabel(" Quantity Ordered ")); mainPanel.add(quantityTextField); mainPanel.add(new JLabel(" Price ")); mainPanel.add(priceTextField); mainPanel.add(calculateButton); mainPanel.add(outputScrollPane); //add the panel to the frame add(mainPanel); setSize(300,400); setVisible(true); } public void actionPerformed(ActionEvent evt) { nameString = bookNameTextField.getText(); quantityInteger = Integer.parseInt(quantityTextField.getText()); priceDouble = Double.parseDouble(priceTextField.getText()); myOrder.Calculation(quantityInteger, priceDouble); displayOutput(); clear(); } public void displayOutput() { //object to format to currency DecimalFormat formatDecimalFormat = new DecimalFormat("$0.00"); DecimalFormat formatNumberFormat = new DecimalFormat("0"); //variables to store the retrieved values from the calculation class double priceDouble, subTotalDouble, shippingDouble, taxDouble, totalDouble, grandTotalDouble; int totalNumberOfOrdersInteger; priceDouble = myOrder.getPrice(); System.out.println(priceDouble); subTotalDouble = myOrder.getSubTotal(); shippingDouble = myOrder.getShipping(); taxDouble = myOrder.getTax(); totalDouble = myOrder.getTotal(); grandTotalDouble = myOrder.getGrandTotal(); totalNumberOfOrdersInteger = myOrder.getNumberOfOrders(); //display output outputTextArea.append('\n' + "Name of the Book: " + nameString + '\n' + "Quantity Ordered: " + formatNumberFormat.format(quantityInteger) + '\n' + "Price: " + formatDecimalFormat.format(priceDouble)+ '\n' + '\n' + "Subtotal: " + formatDecimalFormat.format(subTotalDouble) + '\n' + "Shipping: " + formatDecimalFormat.format(shippingDouble) + '\n' + "Tax: " + formatDecimalFormat.format(taxDouble) + '\n'+ "Total: " + formatDecimalFormat.format(totalDouble) + '\n' +'\n' + "Total Quantity To-Date: " + totalNumberOfOrdersInteger + '\n' + " Grand Total To-Date: " + formatDecimalFormat.format(grandTotalDouble) + '\n'); return; } public void clear() { //clear existing text from text fields and request cursor to top bookNameTextField.setText(""); quantityTextField.setText(""); priceTextField.setText(""); bookNameTextField.requestFocus(); } }
^_^ Why are restricted from using the If statement?
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 05-13-2008, 11:10 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
There are lots of simplier way to do this. You just need some time to figure it out. =)
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 05-13-2008, 11:22 AM
Member
 
Join Date: May 2008
Posts: 20
crazydeo is on a distinguished road
Code:
public void actionPerformed(ActionEvent evt) { nameString = bookNameTextField.getText(); quantityInteger = Integer.parseInt(quantityTextField.getText()); priceDouble = Double.parseDouble(priceTextField.getText()); myOrder.Calculation(quantityInteger, priceDouble); displayOutput();
The method Calculation is undefined for the type Calculation is the error that im getting now.
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 05-13-2008, 11:29 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
Hmmmm. . . It works fine here. I didnt change anything in your Calculation Class. Did you change anything in your Calculation Class? I used the Calculation Class you have posted.
Bookmark Post in Technorati
Reply With Quote
  #12 (permalink)  
Old 05-13-2008, 11:30 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
Can you post what the error is?
Bookmark Post in Technorati
Reply With Quote
  #13 (permalink)  
Old 05-13-2008, 11:36 AM
Member
 
Join Date: May 2008
Posts: 20
crazydeo is on a distinguished road
Quote:
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problem:
The method Calculation(int, double) is undefined for the type Calculation at Main.actionPerformed(Main.java:75)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source) at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Those are the errors. Thanks
Bookmark Post in Technorati
Reply With Quote
  #14 (permalink)  
Old 05-13-2008, 11:44 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
hehehe. I got it. Please change your Calculation to this one:

Code:
public void Calculation(int quantityNewInteger, double priceNewDouble) { setQuantity(quantityNewInteger); setPrice(priceNewDouble); calculate(); }
Bookmark Post in Technorati
Reply With Quote
  #15 (permalink)  
Old 05-13-2008, 11:44 AM
Member
 
Join Date: May 2008
Posts: 20
crazydeo is on a distinguished road
Code:
import javax.swing.*; import javax.swing.JTextField; import java.awt.event.*; import java.text.*; import java.awt.*; public class Main extends JFrame implements ActionListener { // All the GUI objects JPanel mainPanel = new JPanel(); JLabel storeLabel = new JLabel(" OrderBook INC. "); JTextField bookNameTextField = new JTextField(20); JTextField quantityTextField = new JTextField(20); JTextField priceTextField = new JTextField(20); JButton calculateButton = new JButton(" Calculate "); JTextArea outputTextArea = new JTextArea("Books Ordered", 10, 25); JScrollPane outputScrollPane = new JScrollPane(outputTextArea); //object of the font Font storeFont = new Font("Arial",Font.BOLD,14); public static void main(String[] args) { //create an object of the class and code the close button Main myBooks = new Main(); myBooks.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public Main() { designFrame(); } public void designFrame() { //set the font and the color storeLabel.setFont(storeFont); storeLabel.setForeground(Color.GRAY); //add the components to the mainPanel mainPanel.add(storeLabel); mainPanel.add(new JLabel(" Book Name ")); mainPanel.add(bookNameTextField); mainPanel.add(new JLabel(" Quantity Ordered ")); mainPanel.add(quantityTextField); mainPanel.add(new JLabel(" Price ")); mainPanel.add(priceTextField); mainPanel.add(calculateButton); mainPanel.add(outputScrollPane); //add the listeners priceTextField.addActionListener(this); calculateButton.addActionListener(this); //add the panel to the frame add(mainPanel); setSize(300,400); setVisible(true); } public void actionPerformed(ActionEvent evt) { getInput(); clear(); } //declaring local variables double quantityDouble, priceDouble; Calculation myOrder; String nameString; public void getInput() { // get input quantityDouble = Double.parseDouble(quantityTextField.getText()); priceDouble = Double.parseDouble(priceTextField.getText()); nameString = bookNameTextField.getText(); //send the input the calculation class myOrder = new Calculation(quantityDouble, priceDouble); displayOutput(myOrder.getQuantity()); } public void displayOutput(double CalculationDouble) { //object to format to currency DecimalFormat formatDecimalFormat = new DecimalFormat("$0.00"); DecimalFormat formatNumberFormat = new DecimalFormat("0"); //variables to store the retrieved values from the calculation class double priceDouble, subTotalDouble, shippingDouble, taxDouble, totalDouble, grandTotalDouble; int totalNumberOfOrdersInteger; priceDouble = myOrder.getPrice(); subTotalDouble = myOrder.getSubTotal(); shippingDouble = myOrder.getShipping(); taxDouble = myOrder.getTax(); totalDouble = myOrder.getTotal(); grandTotalDouble = myOrder.getGrandTotal(); totalNumberOfOrdersInteger = myOrder.getNumberOfOrders(); //display output outputTextArea.append('\n' + "Name of the Book: " + nameString + '\n' + "Quantity Ordered: " + formatNumberFormat.format(quantityDouble) + '\n' + "Price: " + formatDecimalFormat.format(priceDouble)+ '\n' + '\n' + "Subtotal: " + formatDecimalFormat.format(subTotalDouble) + '\n' + "Shipping: " + formatDecimalFormat.format(shippingDouble) + '\n' + "Tax: " + formatDecimalFormat.format(taxDouble) + '\n'+ "Total: " + formatDecimalFormat.format(totalDouble) + '\n' +'\n' + "Total Quantity To-Date: " + totalNumberOfOrdersInteger + '\n' + " Grand Total To-Date: " + formatDecimalFormat.format(grandTotalDouble) + '\n'); } public void clear() { //clear existing text from text fields and request cursor to top bookNameTextField.setText(""); quantityTextField.setText(""); priceTextField.setText(""); bookNameTextField.requestFocus(); } }
I orginally did it this way and everything worked, but was told that the object is not private
Bookmark Post in Technorati
Reply With Quote
  #16 (permalink)  
Old 05-13-2008, 11:53 AM
Member
 
Join Date: May 2008
Posts: 20
crazydeo is on a distinguished road
Thank you sooo much!
Bookmark Post in Technorati
Reply With Quote
  #17 (permalink)  
Old 05-13-2008, 11:56 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
Eku is on a distinguished road
No Problem my friend. . . =)
Bookmark Post in Technorati
Reply With Quote
  #18 (permalink)  
Old 05-13-2008, 12:06 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 524
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
You can now mark this thread as SOLVED...
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why the output is always zero mehrotra.chitij New To Java 12 04-25-2008 05:05 AM
How to redirect the output Java Tip java.io 0 04-04-2008 03:36 PM
Output Redirection Sixtease New To Java 2 03-22-2008 10:59 AM
output