Wierd error any tips?

hey guys am getting a error in my app which is wierd, it says
E:\test>javac Example.java
Example.java:126: cannot resolve symbol
symbol : variable HeightField
location: class Example
heightString = HeightField.getText();
does unresolved symbol mean its not already declared? because i have it for sure. al include the relevant methods below
public void BMIcalc(ActionEvent event)
public String getName() {
          return NameField.getText();
          public String getHeights() {
          return HeightField.getText();
          public String getWeights() {
          return WeightField.getText();
          String  heightString, weightString, result;
          double  height, weight;
          int     BMI;
          // Get input values
        heightString = getHeights(); <<<<<<calling get heights method;
        weightString = getWeights();<<<<<<calling get weights method;
        //Convert input to numbers
        height = convertToDouble(heightString);
        weight = convertToDouble(weightString);
        //Compute the BMI
        BMI = computeBMI(height, weight);
        //Display the result
        result = "Your BMI is " + BMI;
//        BMILabel.setText(result);
       // add( BMILabel );
        doLayout( );
    }anyone got a tip on whats wrong? cheers in advance

this is bad, after i include the method with datarecord class it gets worse error wise. am including the ful code this time sigh this is rough
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.io.*;
import javax.swing.border.*;
class DataRecord extends JPanel {
     JTextField NameField, HeightField, WeightField;
     JRadioButton MaleButton, FemaleButton;
     public DataRecord(int num) {
          JPanel west = new JPanel();
          MaleButton = new JRadioButton("MALE");
          FemaleButton = new JRadioButton("FEMALE");
          ButtonGroup group = new ButtonGroup();
          group.add(MaleButton);
          group.add(FemaleButton);
          west.setLayout(new GridLayout(0,2));
          west.add(new JLabel("Record "+num));
          west.add(new JLabel(""));
          west.add(new JLabel("Name      "));
          NameField = new JTextField(15);
          west.add(NameField);
          west.add(new JLabel("Height      "));
          HeightField = new JTextField(15);
          west.add(HeightField);
          west.add(new JLabel("Weight      "));
          WeightField = new JTextField(15);
          west.add(WeightField);
          west.add(MaleButton);
          west.add(FemaleButton);
          setLayout(new FlowLayout(FlowLayout.CENTER));
          add(west);
          public String getName() {
          return NameField.getText();
          public String getHeights() {
          return HeightField.getText();
          public String getWeights() {
          return WeightField.getText();
public class Example extends JFrame implements ActionListener {
     JPanel recordsPanel;
     ArrayList Records;
     JButton Save, add, CalcBMI;
     public Example() {
          setTitle("Example");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          setResizable(true);
          Records = new ArrayList();          
          Records.add(new DataRecord(1));
          recordsPanel = new JPanel();
          recordsPanel.setLayout(new GridLayout(0,1));
          recordsPanel.add((DataRecord)Records.get(0));
          Container c = getContentPane();
          c.setLayout(new BorderLayout());
          JScrollPane jsp = new JScrollPane(recordsPanel,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
          c.add(jsp,BorderLayout.CENTER);
          JPanel south = new JPanel();
          south.setLayout(new FlowLayout(FlowLayout.CENTER));
          CalcBMI= new JButton("Calculate BMI");
          south.add(CalcBMI);
          CalcBMI.addActionListener(this);
          add = new JButton("Add Record");
          south.add(add);
          add.addActionListener(this);
          Save = new JButton("Save Records");
          south.add(Save);
          Save.addActionListener(this);
          c.add(south,BorderLayout.SOUTH);
          pack();
          setSize(this.getWidth(),400);
          show();
     public void actionPerformed(ActionEvent e) {
          if (e.getSource() == Save) {
               try {
               catch (IOException ioe) {
                    ioe.printStackTrace();
          else if (e.getSource() == add) add();
     protected void add() {
          DataRecord dr = new DataRecord(Records.size()+1);
          Records.add(dr);
          recordsPanel.add(dr);
          validate();
public void BMIcalc(ActionEvent event)
          String  heightString, weightString, result;
          double  height, weight;
          int     BMI;
          // Get input values
        heightString = getHeights();
        weightString = getWeights();
        //Convert input to numbers
        height = convertToDouble(heightString);
        weight = convertToDouble(weightString);
        //Compute the BMI
        BMI = computeBMI(height, weight);
        //Display the result
        result = "Your BMI is " + BMI;
//        BMILabel.setText(result);
       // add( BMILabel );
        doLayout( );
     private int computeBMI(double height, double weight)
        int BMI;
        BMI = (int) Math.round( weight / (height*height) );
        return BMI;
private double convertToDouble( String str )
        Double doubleObj = new Double( str );
        return doubleObj.doubleValue( );
public static void main(String[] args) {
          new Example();
}

Similar Messages

  • My iPhone says it needs to be restored, but on connecting to iTunes i get unknown error, and unable to restore: any tips?

    On 2 occasions my iphone has come up with the message that it needs to be restored to factory settings, but on trying to do this, itunes displays the message that it is unable to restore phone due to unknown error.  Any tips?

    Unless you have a jailbroken phone that has altered the baseband, that usually a hardware failure, in which case you'll have to take it to the Apple store for evaluation.

  • HT5654 I often travel abroad and my host has changed Internet provider. Then my service was interrupted and I can't update iTunes. Any tips to stop the error messages?

    I often travel abroad and my host has changed Internet provider. Then my service was interrupted and I can't update iTunes. Any tips to stop the error messages?

    Wow! At least on Apple TV, problem solved. Apple: what's not to love? Please give me credit if you use it in marketing campaigns... ;-)

  • I would like to update my Adobe ID and main email - I'm getting an error when trying to do this in my account settings. Any tips?

    I would like to update my Adobe ID and main email - I'm getting an error when trying to do this in my account settings. Any tips?

    Change/Verify Account https://forums.adobe.com/thread/1465499 may help
    -http://helpx.adobe.com/x-productkb/policy-pricing/change-country-associated-with-adobe-id. html
    -Credit card https://helpx.adobe.com/utilities/credit-card.html
    -email address https://forums.adobe.com/thread/1446019

  • Tried unsuccessfully to restore my MBP, running the Mac OSX Lion, to factory settings. I keep getting the "can't download additional components for the Mac OSX Lion" error when reinstalling the OSX Lion. Any tips on how to resolve this problem?

    Hello! Tried unsuccessfully to restore my MBP, running the Mac OSX Lion, to factory settings. I keep getting the "can't download additional components for the Mac OSX Lion" error when reinstalling the OSX Lion. Any tips on how to resolve this problem?

    Hi
    Given that your answer to 1. is 'pre-installed' and 3. is 'No', I think the only thing to do is to take it to an Apple store (ideally the one you bought it from) and have them reinstall it for you.
    The intended solution in cases like yours is that you should be able to reboot and install even a wiped disk by using Apple's servers over the internet (you do this by restarting with 'command-r' and choosing 'reinstall Lion'). However if this isn't working for you then you need to get the store to do it. Don't let them fob you off with 'go home and try again'. Have them do it in the shop (you're still covered by Applecare warranty so it should cost you nothing save the inconvenience of the trip and possibly leaving the machine there while they fix it).
    A reinstall should leave all your own personal data and programs in place.
    Note for future: when you get it fixed, first thing to do is buy a cheap external drive and start keeping a backup (either Time Machine or clone with Carbon Copy Cloner).
    Message was edited by: softwater

  • Hey I'm getting an error when I'm using an AU plugin its saying"Host Error: illegal midi databyte2 an my logic crashes any tips? thanks

    hey I'm getting an error when I'm using an AU plugin its saying"Host Error: illegal midi databyte2 an my logic crashes any tips? thanks

    There is a minor issue with Logic where Logic sends corrupt midi data
    to plugins when recording in loopmode (looptool),
    we've released a hotfix for ElectraX 1.2 as well as fixed this in
    ElectraX 1.3 (currently in beta).
    ElectraX 1.3 is set for release in early July and if I remember
    correct the current ElectraX demo also has the fix included,
    so redownloading/reinstalling the demo should take care of it.
    In the meanwhile another possible workaround is to switch off
    loopmode when recording.
    from TONE 2

  • TS3694 iOS 7.02 update made my iPad stay frozen on the appl logo.  What's more, a factory update in DFU mode won't work either, I get error code 3194 - any tips on what I should do?  It is an iPad2 on iOS 5 something, the one just before Apple removed You

    iOS 7.02 update made my iPad stay frozen on the appl logo.  What's more, a factory update in DFU mode won't work either, I get error code 3194 - any tips on what I should do?  It is an iPad2 on iOS 5 something, the one just before Apple removed YouTube...

    iOS 7.02 update made my iPad stay frozen on the appl logo.  What's more, a factory update in DFU mode won't work either, I get error code 3194 - any tips on what I should do?  It is an iPad2 on iOS 5 something, the one just before Apple removed YouTube...

  • TS3694 keep geting error code 1015 when trying to update my iphone 3gs any tips to sort it out

    keep geting error code 1015 when trying to update my iphone 3gs any tips to sort it out

    https://discussions.apple.com/message/19425288#19425288
    https://discussions.apple.com/message/18882000#18882000
    https://discussions.apple.com/message/18526759#18526759
    http://support.apple.com/kb/TS3694?viewlocale=en_US
    Errors related to downgrading iOS
    The required resource cannot be found: This alert message occurs when your device has a newer version of iOS than what is available in iTunes. When troubleshooting a device that presents this alert message, go toSettings > General > About and check the version of iOS on the device. If it is newer than the latest released iOS version, the device may have a prerelease developer version of iOS installed. Installing an older version of iOS over a newer version is not supported.
    Error 1015: This error is typically caused by attempts to downgrade the iPhone, iPad, or iPod touch's software. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version is not supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you are now trying to restore to an authorized, default state.
    There is not much you can do, sorry 

  • Itunes suddenly stopped working and i cant  re-install. Get error message (I believe error 7). Any tips?

    Itunes suddenly stopped working and i cant  re-install. Get error message (I believe error 7). Any tips?

    Hello, Ruud1234. 
    Thank you for visiting Apple Support Communities.
    Here are the steps I would recommend going through as they should resolve the issue.
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Cheers,
    Jason H.

  • I have not been able to access itunes store for over a week now.  I keep getting error -1202.  I have updated to latest version of itunes but problem still exists.  Any tips?

    I have not been able to access itunes store for over a week now.  I keep getting error -1202.  I have updated to latest version of itunes but problem still exists.  Any tips?

    See this one
    https://discussions.apple.com/thread/3742260?start=0&tstart=0

  • Acrobat Pro won't update from 10.1.6 to 10.1.7, any tips, on Mac-

    Acrobat Pro won't update from 10.1.6 to 10.1.7, any tips, on Mac…?

    One of two things:
    1.  Go to the Terminal App and type the word "sudo" and hit the Enter/Return key.  If it comes back with a permissions error then seek from Apple to correct it.
    2.  If there is no permissions error in the Terminal app then go to the installation log at "/var/log/install.log" or "/private/var/log/install.log".  Open it up and see if you find an error about failing to write to the file:
    ./postinstall: Error in converting the plist /Library/Preferences/com.adobe.PDFAdminSettings.plist to xml1 format
    If you get the error above then delete the file at the location and try updating again

  • Any tips for novel writing in Pages?

    I am determined to finish my next novel in Pages. I can't take the weight of Word any more. Does anyone have any tips for using Pages in this way, producing a manuscript that will probably run to 130k words in the end? I have tried everything in this field on OS X, from Mellel to Nisus, Ulysses and Copywrite, and I think Pages suits me best.
    What I have discovered so far...
    Good points
    Reliability
    Ease of use
    Speed
    The fantastic search and I think unique show search feature which is now my primary way of navigating the manuscript.
    Could be better
    No keyboard shortcuts for styles
    It's simpler to number chapters manually than mess around with lists
    The word count is awkward to get at
    No outlining or easy navigation by chapters
    Occasionally I get red underline spelling errors for words that are spelled correctly. This goes away if I right click and may be due to hyphenation though that is turned off for the document.
    G5 dual   Mac OS X (10.4.2)  

    Bodsham,
    I started my novel with Nisus, switched to CopyWrite, then wrote the bulk of it with Pages. All in all, using Pages was a terrific experience. But the use of a word processor for a novelist is a very, very personal and subjective thing.
    Things a novelist might like about Pages
    - What you see on the screen is beautiful -- Pages renders text extremely well
    - The system for defining styles is excellent. When I first fired up Pages 1.0, it took me 15 minutes to make a complete manuscript template, including headers
    - It's very stable. Unlike Nisus, which was a nightmare (adding blank pages and weird indents all through the document), Pages behaves itself very well
    - Plays nice with Word. I'm able to open and export Word docs very successfully
    - Brilliant search feature; provides a list of word occurances, then lets you click on them
    - Bookmark feature lets you easily jump from chapter to chapter
    Things a novelist might not like about Pages
    - A few people report a typing lag. If you experience it, it's a significant problem
    - Bookmarks, while excellent, won't permanently sort alphabetically -- only numerically. Every time I open my document, my bookmarked list of chapters is sorted incorrectly. Not a big deal; just a minor annoyance
    - Very mouse-intensive program. Not a huge issue for a novelist since we mostly just hit a carriage return; not a lot of styles in a text-based manuscript
    - Gobbles up a lot of screen real estate. In order to have various inspectors and panes open, it's good to have a larger monitor, otherwise you'll find things sitting on top of your text
    I'm sure there are many more strengths and weaknesses, but that'll get you started. By the way, you can download Devon Technologies' excellent and free Word Services that'll add a lot of very useful features (including word count) to your services menu. Get it at http://www.devon-technologies.com/download/index.html
    -Dennis

  • Waveburner won't recognize my M-Audio Fast Track after upgrade to Lion. Any tips?

    Doesn't show up in drop-down menu under Audio preferences like it should. Tried restarting the sound card etc etc. Everything works fine in Logic (and iTunes etc. Just not in Waveburner.) I use Waveburner all the time for mastetring and this is a pain. Any tips on a fix or workaround?
    Thanks!

    Did that work for you?  I was looking at that too, but was discouraged by having to use a sparsebundle given Snow Leopard had such great NAS support. 
    FYI to everyone else, I upgraded my ReadyNAS firmware to 4.1.8.  NetGear indicated the following updates with the nre firmware, but it didn't fix this problem:
         New features and enhancements
         1. Added support for Mac OS X 10.7 “Lion”.
         2. Added warning when NFS access to home shares is enabled.
         3. Added a redirect for http://<host>/ip to https.
         4. Added enhancements to advanced AFP permission settings.
         5. Provide download links for exported users and groups instead of asking for email.
         6. Updated ReadyNAS Remote to the latest revision.
         Bug fixes
         1. Fixed javascript error in FrontView.
         2. Delay auto power-off if backup jobs are still queued.
         Limitations
         1. IE 6 no longer supported.
         2. Drives greater than 2TB are not supported.
    I found this link which I thought had some useful information: http://carryflag.blogspot.com/2010/06/imovie-event-library-on-network-drive.html
    Some people reported success with the terminal command:
         defaults write -app iMovie allowNV -bool true
    But apparantly, after the Lion update, fewer people reported success with it.  Still looking though... If anyone else has more symptoms to add, please let me know.  I might try to use a sniffer program and see if I can pull a packet capture.  That might reveal some info.... 
    On another note, has anyone had any problems connecting to their Time Capsule in the same fashion?  I had an idea of connecting a USB Raid Array to it and connecting through the TC, but wanted to know if anyone had any thoughts or experience with that....  Thanks.

  • I am unable to play youtube videos on WiFi or on my my cell network. Any tips would be appreciated. Thanks

    I am unable to play youtube videos on WiFi or on my my cell network. Any tips would be appreciated. Thanks

    Hi, first of all Thank you for your instant response.
    Yes, I have updated to version 33, Now the problem is not as random as it was before. I found that I have absolutely no issues when I use FF for the first time after starting my computer. At this point there is no issue at all I can watch videos when both logged-in/logged-out and also they work perectly if I switch between flash and HTML5.
    But as soon as I restart Firefox I cannot watch the videos at all. No matter if I am logged in/logged out, I did try HTML5 but still it didn't work. The error message was same in all the cases "An error occurred, please try again later".
    We are secured by "Cyberoam" so I don't have access to proxy sites.
    By the way these observations are for Windows 7.

  • Had to reinstall itunes onto my pc, but now can't get onto itunes store any tips

    had to reinstall itunes onto my pc. but now can't get onto itunes store any tips

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page). Here's a screenshot showing the particular links on the page that you should be clicking:
    After clicking one of the circled links, you should be taken to another page, and after a few seconds you should see a download dialog appear for the msicuu2.exe file. Here's a screenshot of what it looks like for me in Firefox:
    Choose to Save the file. If the dialog box does not appear for you, click the link on the page that says "CLICK HERE IF IT DOES NOT". Here's a screenshot of the page with the relevant link circled:
    When the dialog appears, choose to save the file.
    (2) Go to the Downloads area for your Web browser. Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

Maybe you are looking for