473,769 Members | 6,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cannot find symbol method parseint(java.l ang.String)

5 New Member
I am getting this error message in the program I'm working on (line 150), and am wondering what it means? This is an exercise for a college class; just want to declare that; this is not my own work.

Here is the program that I am working with:

Expand|Select|Wrap|Line Numbers
  1. // This application inputs and outputs account information.
  2. import java.awt.*;
  3. import java.awt.event.*;
  4. import javax.swing.*;
  5. import javax.swing.border.*;
  6.  
  7. public class AccountInformation extends JFrame
  8. {
  9.    // JPanel to group deposit components
  10.    private JPanel enterJPanel;
  11.  
  12.    // JLabel and JTextField for deposits
  13.    private JLabel depositJLabel;
  14.    private JTextField depositJTextField;
  15.  
  16.    // JButton to initiate balance calculation
  17.    private JButton enterJButton;
  18.  
  19.    // JPanel to group account information components
  20.    private JPanel accountJPanel;
  21.  
  22.    // JLabel and JTextField for account holder's name
  23.    private JLabel nameJLabel;
  24.    private JTextField nameJTextField;
  25.  
  26.    // JLabel and JTextField for account number
  27.    private JLabel accountNumberJLabel;
  28.    private JTextField accountNumberJTextField;
  29.  
  30.    // JLabel and JTextField for balance
  31.    private JLabel balanceJLabel;
  32.    private JTextField balanceJTextField;
  33.  
  34.    // no-argument constructor
  35.    public AccountInformation() 
  36.    {
  37.       createUserInterface();
  38.    }
  39.  
  40.    // create and position GUI components; register event handlers
  41.    private void createUserInterface()
  42.    {
  43.       // get content pane and set layout to null
  44.       Container contentPane = getContentPane();
  45.       contentPane.setLayout( null );
  46.  
  47.       // set up enterJPanel
  48.       enterJPanel = new JPanel();
  49.       enterJPanel.setLayout( null );
  50.       enterJPanel.setBounds( 16, 16, 152, 126 );
  51.       enterJPanel.setBorder( 
  52.          new TitledBorder( "Enter information" ) );
  53.       contentPane.add( enterJPanel );
  54.  
  55.       // set up depositJLabel
  56.       depositJLabel = new JLabel();
  57.       depositJLabel.setText( "Deposit amount:" );
  58.       depositJLabel.setBounds( 16, 40, 140, 16 );
  59.       enterJPanel.add( depositJLabel );
  60.  
  61.       // set up depositJTextField
  62.       depositJTextField = new JTextField();
  63.       depositJTextField.setText( "0" );
  64.       depositJTextField.setBounds( 16, 56, 120, 21 );
  65.       depositJTextField.setHorizontalAlignment( JTextField.RIGHT );
  66.       enterJPanel.add( depositJTextField );
  67.  
  68.       // set up enterJButton
  69.       enterJButton = new JButton();
  70.       enterJButton.setText( "Enter" );
  71.       enterJButton.setBounds( 16, 150, 152, 34 );
  72.       contentPane.add( enterJButton );
  73.       enterJButton.addActionListener(
  74.  
  75.          new ActionListener() // anonymous inner class
  76.          {
  77.             // event handler called when enterJButton is pressed
  78.             public void actionPerformed( ActionEvent event )
  79.             {
  80.                enterJButtonActionPerformed( event );
  81.             }
  82.  
  83.          } // end anonymous inner class
  84.  
  85.       ); // end call to addActionListener
  86.  
  87.       // set up accountJPanel
  88.       accountJPanel = new JPanel();
  89.       accountJPanel.setLayout( null );
  90.       accountJPanel.setBounds( 180, 16, 136, 170 );
  91.       accountJPanel.setBorder( 
  92.          new TitledBorder( "Account information" ) );
  93.       contentPane.add( accountJPanel );
  94.  
  95.       // set up nameJLabel
  96.       nameJLabel = new JLabel();
  97.       nameJLabel.setText( "Name:" );
  98.       nameJLabel.setBounds( 16, 24, 100, 16 );
  99.       accountJPanel.add( nameJLabel );
  100.  
  101.       // set up nameJTextField
  102.       nameJTextField = new JTextField();
  103.       nameJTextField.setText( "Sue Purple" );
  104.       nameJTextField.setBounds( 16, 40, 104, 21 );
  105.       nameJTextField.setEditable( false );
  106.       accountJPanel.add( nameJTextField );
  107.  
  108.       // set up accountNumberJLabel
  109.       accountNumberJLabel = new JLabel();
  110.       accountNumberJLabel.setText( "Account Number:" );
  111.       accountNumberJLabel.setBounds( 16, 70, 140, 16 );
  112.       accountJPanel.add( accountNumberJLabel );
  113.  
  114.       // set up accountNumberJTextField
  115.       accountNumberJTextField = new JTextField();
  116.       accountNumberJTextField.setText( "12345" );
  117.       accountNumberJTextField.setBounds( 16, 86, 104, 21 );
  118.       accountNumberJTextField.setEditable( false );
  119.       accountNumberJTextField.setHorizontalAlignment( 
  120.          JTextField.RIGHT );
  121.       accountJPanel.add( accountNumberJTextField );
  122.  
  123.       // set up balanceJLabel
  124.       balanceJLabel = new JLabel();
  125.       balanceJLabel.setText( "Balance:" );
  126.       balanceJLabel.setBounds( 16, 116, 100, 16 );
  127.       accountJPanel.add( balanceJLabel );
  128.  
  129.       // set up balanceJTextField
  130.       balanceJTextField = new JTextField();
  131.       balanceJTextField.setText( "0" );
  132.       balanceJTextField.setBounds( 16, 132, 104, 21 );
  133.       balanceJTextField.setEditable( false );
  134.       balanceJTextField.setHorizontalAlignment( JTextField.RIGHT );
  135.       accountJPanel.add( balanceJTextField );
  136.  
  137.       // set properties of application's window
  138.       setTitle( "Account Information" ); // set title bar text
  139.       setSize( 340, 225 );               // set window size
  140.       setVisible( true );                // display window
  141.  
  142.    } // end method createUserInterface
  143.  
  144.    // method called when enterJButton is pressed
  145.    private void enterJButtonActionPerformed( ActionEvent event )
  146.    {
  147.       // display new balance
  148.       balanceJTextField.setText( String.valueOf( 
  149.          Integer.parseint( balanceJTextField.getText() ) * 
  150.          Integer.parseint( depositJTextField.getText() ) ) );
  151.  
  152.       // clear depositJTextField
  153.       depositJTextField.setText( "0" );    
  154.  
  155.    } // end method enterJButtonActionPerformed
  156.  
  157.    // main method
  158.    public static void main( String[] args ) 
  159.    {
  160.       AccountInformation application = new AccountInformation();
  161.       application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
  162.  
  163.    } // end method main
  164.  
  165. } // end class AccountInformation
Oct 15 '07 #1
1 11608
dmjpro
2,476 Top Contributor
Use code Tags, while you do Post.

use "Integer.parseI nt" means you written "parseint".
And follow the method name convention in Java.


Debasis Jana
Oct 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4727
by: Sergio | last post by:
I want to execute a method of one applet from one page HTML. If I execute the method that it reads from rows from init() all it works. f instead I execute the method through document.applet.method() I obtain one Exception java.security.AccessControlException: access denied. Where mistake? Thanks Sergio
0
1259
by: Robin Tucker | last post by:
I'm localizing and need to find all string literals in my source code. I don't want to find any of the literals that will end up in resources however. As I don't use the "Me" keyword, I know these are found in the InitialiseComponent method and are therefore literals on a line of code preceeded with "Me.". So, is there a regular expression that will find all literals NOT on a line preceeded with "Me."? Thanks :/
6
2782
by: bobueland | last post by:
The module string has a function called translate. I tried to find the source code for that function. In: C:\Python24\Lib there is one file called string.py I open it and it says
2
12839
by: Bryan_Cockrell | last post by:
Hi World, I am extracting text from an ebcdic header using dd in the cygwin environment (bash/ksh) as below in order to rename the file to something intelligent. I'm using a specific string position here ($10) but the text I extract is sometimes in a different position in the header so I need to search for preceding text "LINE:" and then extract the next string, which is the info I'm interested in. So - using awk or sed (or perl if need...
2
2534
by: csharpula csharp | last post by:
Hello, I want to implement "wild card" search by searching files with *name* criteria. What is the best way? Should I do foreach to all names or maybe there is a better way? *** Sent via Developersdex http://www.developersdex.com ***
13
14984
by: nishit.gupta | last post by:
Is their any fuction available in C++ that can determine that a string contains a numeric value. The value cabn be in hex, int, float. i.e. "1256" , "123.566" , "0xffff" Thnx
3
2241
by: shapper | last post by:
Hello, I have two arrays of strings, s1 and s2: s1 = "london, lisbon, paris, newyork" s2 = "lisbon, yellow, France" s2 will have only one item included in s1.
1
1574
by: =?Utf-8?B?SGlwZXJpWA==?= | last post by:
Hello, I am workin' on creating web from as pdf file. My pdf file size is 595 x 820 points. Can anybody tell how can I count the length of my string in points? string x;
2
1793
by: korean_dave | last post by:
How can i use the find() function on a string that is composed of tons of symbols that cause errors... THis is my string: find("<html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight: 400; font-style:normal; text-decoration:none;"><p style=" margin-top: 0px; margin-bottom:0px; margin-left:0px;...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.