Something wrong with my code

there is no exception in compliation,but when i run it, there are a lot of exceptions like this:
Compilation of '/opt/bea/user_projects/domains/mydomain/./myserver/.wlnotdelete/extract/myserver_PHSWeb_PHSWeb/jsp_servlet/__test.java' failed:
/opt/bea/user_projects/domains/mydomain/./myserver/.wlnotdelete/extract/myserver_PHSWeb_PHSWeb/jsp_servlet/__test.java:161: cannot resolve symbol
probably occurred due to an error in /test.jsp line 16:
ele = UserLogic.SendChargeInfo();
Full compiler error(s):
/opt/bea/user_projects/domains/mydomain/./myserver/.wlnotdelete/extract/myserver_PHSWeb_PHSWeb/jsp_servlet/__test.java:161: cannot resolve symbol
symbol : method SendChargeInfo ()
location: class com.jinchen.phs.user.UserLogic
ele = UserLogic.SendChargeInfo(); //[ /test.jsp; Line: 16]
^
1 error
Tue Aug 10 16:20:36 CST 2004
What's wrong and how to correct? thank you!!

The simplest interpretation is you forgot to write:
UserLogic ele = ....You could look into the .java source which was generated from your test.jsp, line 16.
That might clear things.
As "ele" doesn't ring a bell to me, it also might be the rest of a variable name broken on a special character,
because the compiler system uses an other character encoding, than your text editor.

Similar Messages

  • Autoplays in IE but not FF - Something wrong with my code?

    PLEASE help. I have searched the net and tried just about everything I came across. I created this movie in SwishMax 3. I recreated it in Dreamweaver 8. When I saved it, it saved as a .swf and also an HTML file. There was no .jsf to be seen anywhere.
    I got the page to auto-play in IE finally, but I CANNOT get it to auto-play in Firefox, no matter what I do. It DOES work if I right click on the screen and click "Play", but that is not what I need.
    Any assistance would be greatly appreciated.
    I have tried about 30 possible "fixes" before asking for help, to no avail.
    I need to have at least this page up by tomorrow, if possible. If you see any error that may be preventing me from getting this movie to auto-play upon screen load, I would greatly appreciate you pointing the error out to me.
    Thank you, in advance!
    -Christine
    Here is the website to which I will (once fixed) direct all users automatically:
    http://axissalonsc.com/index.html
    Here is all of the code for my homepage:
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Axis Salon Home</title>
    </head>
    <body bgcolor="#000000">
    <p align="center"><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html40/loose.dtd">
    <html>
    <head>
    <title>Home</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="author" content="Christine C. Baker">
    <meta name="description" content="">
    <meta name="keywords" content="209, 2947, 29527, 488, 843, appointment, axis, bring, call, conway, diligently, in, laurel, live, loading, meantime, please, salon, sc, schedule, site, st, this, welcome, working, your">
    <!-- text used in the movie -->
    <!-- 209, 2947, 29527, 488, 843, appointment, axis, bring, call, conway, diligently, -->
    <!-- in, laurel, live, loading, meantime, please, salon, sc, schedule, site, st, -->
    <!-- this, welcome, working, your -->
    <style type="text/css">
    /*<![CDATA[*/
    html, body
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    object
    vertical-align: top;
    /*]]>*/
    </style>
    </head>
    <body bgcolor="#000000">
    <center>
    <object
    classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,32,18"
    id="Home.swf"
    width="800" height="480"
    >
    <param name="movie" value="Home.swf">
    <param name="bgcolor" value="#000000">
    <param name="play" value="true">
    <param name="quality" value="high">
    <param name="seamlesstabbing" value="false">
    <param name="allowscriptaccess" value="samedomain">
    <embed
    type="application/x-shockwave-flash"
    pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
    name="Home.swf"
    width="800" height="480"
    src="http://axissalonsc.com/Home.swf"
    bgcolor="#000000"
    quality="high"
    seamlesstabbing="false"
    allowscriptaccess="samedomain"
    >
    </embed>
    </object>
    </center>
    </body>
    </html>
    </p>
    </body>
    </html>

    Hi,
    Why dont you try adding the play attribute in the embed tag:
    <embed
    type="application/x-shockwave-flash"
    pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=Shoc kwaveFlash"
    name="Home.swf"
    width="800" height="480"
    src="http://axissalonsc.com/Home.swf"
    bgcolor="#000000"
    quality="high"
    seamlesstabbing="false"
    allowscriptaccess="samedomain"
    play="true"
    >
    \Not sure if this will work..just a try.
    Warm Regards
    Deepanjan Das
    http://deepanjandas.wordpress.com/

  • FB4 doesn't tell me what's wrong with my code. Not even letting me trace().

    Attached is my code that run well but the problem is, I know there is something wrong with my code since the dropdown list isn't populated unlike the textarea. Doesn't even put anything on the output panel when i do trace()-ing.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/halo"
    creationComplete="application1_initializeHandler(event)">
    <s:layout>
    <s:BasicLayout/>
    </s:layout>
    <fx:Script>
    <![CDATA[
    import mx.events.FlexEvent;
    protected function application1_initializeHandler(event:FlexEvent):void
    var xml:XML;
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest('data/places.xml'));
    xmlLoader.addEventListener(
    Event.COMPLETE,
    function (e:Event):void {
    xml = new XML(e.target.data);
    trace(xml.place[0].barangay.descendants().toXMLString());
    for each (var pro:Object in xml.places.place)
    dp.dataProvider.addItem({province:pro.province});
    ta.text = xml.place[0].barangay.descendants().toXMLString();
    ]]>
    </fx:Script>
    <s:DropDownList id="dp"
    labelField="province"
    width="197"
    x="10" y="10"/>
    <s:TextArea x="198" y="186" id="ta" editable="true"/>
    </s:Application>

    @jdesko:
    i tried both with or w/o the nightly builds, still i can't see anything on the output panel using trace and the above code doesn't trigger the Error Panel why the dropdown list isn't populated..
    @Jason: thanks. the prob was with my e4x expression but with the console output thingy, now i run in debug mode but got the error:
    C:\Windows\System32\Macromed\Flash\NPSWF32.dll
    Flash Builder cannot locate the required debugger version of Adobe Flash Player. You might need to install the debugger version of the Flash Player or reinstall Flash Builder.
    Do you want to try to debug with the current version?
    I thought FB4 has this already in the package. I'm wondering why it asks for like this.

  • Something's Wrong with my Code!

    Hi everyone,
    I am creating a quiz that limit the user to 10seconds for
    answering each question. After i added in my Timer MC and attach it
    onto the stage, i tested it out. Upon submitting question 2's
    answer, the flash goes crazy. It will keep playing itself to the
    next few questions without stopping all the way to the last frame.
    What is wrong with my code?
    Here's my Timer, Question 1 and 2 Coding.
    The rest of the question's coding are around the same as
    question 2 except for the checking of the right answer part.

    Removing the MovieClip does not stop the setInterval; you
    still need to use clearInterval when you want to dispose of the
    timer before the timer has reached the end. Perhaps you could add
    somethng like:
    function killMe(){
    clearInterval(nInterval);
    this.removeMovieClip();
    in your Timer.
    And then use Timer.killMe(); instead of your
    Timer.removeMovieClip();

  • Process audio from mic and play it back. (What is wrong with my code?)

    Hi, I am trying to take the audio from the mic (at javasound://0), process it (add the JMF API sample plug in GainEffect.java) and then play the processed data source. The code I have so far is below.
    I am getting no errors - compiles fine - but nothing seems to be happening.
    The grand goal is to take the audio being captured from the mic and process it in real time using a plug in (not necessarily GainEffect) and also play it back (the processed audio) at the same time.
    Where am I going wrong? Thanks!
    import java.io.IOException;
    import java.util.Vector;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.format.AudioFormat;
    import javax.media.protocol.DataSource;
    public class audioProcess {
         public static void main(String[] args){
              CaptureDeviceInfo audioCapDevInfo = null;
              Vector audioCapDevList = null;
              Vector plugIn;
              Player p;
              Processor pro = null;
              TrackControl[] tracks;
              DataSource ds;
              Vector plug;
              TrackControl audioTrack = null;
              AudioFormat audFormat = new AudioFormat(
                   AudioFormat.LINEAR,
                   44100,
                   16,
                   2,
                   AudioFormat.LITTLE_ENDIAN,
                   AudioFormat.SIGNED,
                   16,
                   Format.NOT_SPECIFIED,
                   Format.byteArray);
              Format[] alinear=new AudioFormat[]{new AudioFormat(     AudioFormat.LINEAR,
                        44100,
                        16,
                        2,
                        AudioFormat.LITTLE_ENDIAN,
                        AudioFormat.SIGNED,
                        16,
                        Format.NOT_SPECIFIED,
                        Format.byteArray)};
            audioCapDevList = CaptureDeviceManager.getDeviceList(audFormat);        
            if ((audioCapDevList.size() > 0)) {
                 audioCapDevInfo = (CaptureDeviceInfo) audioCapDevList.elementAt(0);
                audioCapDevLoc = audioCapDevInfo.getLocator();
            MediaLocator dest = new MediaLocator("javasound://0");  //take sound captured directly from microphone
            try{             
                 PlugInManager.addPlugIn("GainEffect", alinear, alinear, 3);
                 plug = PlugInManager.getPlugInList(audFormat, audFormat, 3);
                 int vectorSize = plug.size();
                 if(plug.elementAt(vectorSize - 1).equals("GainEffect")){
                      plug.removeElementAt(vectorSize - 1);
                      plug.insertElementAt("GainEffect", 0);
                      PlugInManager.setPlugInList(plug, 3);
                      PlugInManager.commit();
                 pro = Manager.createProcessor(dest);
                 pro.configure(); //must configure before call getTrackControls
                 while(pro.getState() != Processor.Configured);
                 tracks = pro.getTrackControls();
                 for (int i = 0; i < tracks.length; i++){
                      if(tracks.getFormat() instanceof AudioFormat){
                   audioTrack = tracks[i];
                   break;
         //add plug in effect
         try{
              Codec codec[] = {new  GainEffect()};
              audioTrack.setCodecChain(codec);
         } catch (UnsupportedPlugInException e){
         pro.realize();
         while(pro.getState() != Processor.Realized);
         ds = pro.getDataOutput();
         p = Manager.createRealizedPlayer(ds);
         p.start();
    catch(NoPlayerException e){
         e.printStackTrace();
    } catch (IOException e) {
              e.printStackTrace();

    Ok, I narrowed my code down to this. There doesn't appear to be any infinite loops in the code now, but perhaps I'm wrong? The processor is realizing, and I am creating a player with the data source output from the processor, yet there still is nothing playing... which leads me to think that there is something wrong with my plug in implementation or my processor creation. Do you have any ideas or points in the right direction?
    import java.io.IOException;
    import java.util.Vector;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.format.AudioFormat;
    import javax.media.protocol.DataSource;
    public class audioCapture {
         public static void main(String[] args){
              MediaLocator audioCapDevLoc = null;
              CaptureDeviceInfo audioCapDevInfo = null;
              Vector audioCapDevList = null;
              Vector plugIn;
              Player p;
              Processor pro = null;
              TrackControl[] tracks;
              DataSource ds;
              Vector plug;
              TrackControl audioTrack = null;
              AudioFormat audFormat = new AudioFormat(
                   AudioFormat.LINEAR,
                   44100,
                   16,
                   2,
                   AudioFormat.LITTLE_ENDIAN,
                   AudioFormat.SIGNED,
                   16,
                   Format.NOT_SPECIFIED,
                   Format.byteArray);
              Format[] alinear=new AudioFormat[]{new AudioFormat(     AudioFormat.LINEAR,
                        44100,
                        16,
                        2,
                        AudioFormat.LITTLE_ENDIAN,
                        AudioFormat.SIGNED,
                        16,
                        Format.NOT_SPECIFIED,
                        Format.byteArray)};
            audioCapDevList = CaptureDeviceManager.getDeviceList(audFormat);        
            if ((audioCapDevList.size() > 0)) {
                 audioCapDevInfo = (CaptureDeviceInfo) audioCapDevList.elementAt(0);
                audioCapDevLoc = audioCapDevInfo.getLocator();
            try{
            MediaLocator dest = new MediaLocator("javasound://0"); //take signal from soundcard
                 PlugInManager.addPlugIn("GainEffect", alinear, alinear, 3); //register plug in
                 plug = PlugInManager.getPlugInList(audFormat, audFormat, 3);
                 int vectorSize = plug.size();
                 if(plug.elementAt(vectorSize - 1).equals("GainEffect")){ //take the last plug in
                      plug.removeElementAt(vectorSize - 1);
                      plug.insertElementAt("GainEffect", 0);
                      PlugInManager.setPlugInList(plug, 3);
                      PlugInManager.commit();
                 pro = Manager.createProcessor(dest);
                 pro.configure(); //must configure before call getTrackControls
                 while(pro.getState() != Processor.Configured);
                 tracks = pro.getTrackControls();
                 for (int i = 0; i < tracks.length; i++){
                      if(tracks.getFormat() instanceof AudioFormat){
                   audioTrack = tracks[i];
                   break;
    Codec codec[] = {new  GainEffect()}; //add plug in effect
         audioTrack.setCodecChain(codec);
         pro.realize();
         while(pro.getState() != Processor.Realized); //don't move on until realized
         ds = pro.getDataOutput();
         p = Manager.createRealizedPlayer(ds); //create a player using the data source from the processor
         p.start();
    catch (IOException e){
         e.printStackTrace();
    catch (CannotRealizeException e){
         e.printStackTrace();
    catch(NoPlayerException e){
         e.printStackTrace();
    catch(UnsupportedPlugInException e){
         e.printStackTrace();
    PS - sorry for the late reply.

  • I'm trying to add the system date with a Label. What is wrong with the code

    import java.util.*;
    import javax.swing.*;
    public class CurrentDateApplet extends JApplet
         Calendar currentCalendar = Calendar.getInstance();
         JLabel dateLabel = new JLabel();
         JPanel mainPanel = new JPanel();
         int dayInteger = currentCalendar.get(Calendar.DATE);
         int monthInteger = currentCalendar.get(Calendar.MONTH)+1;
         int yearInteger = currentCalendar.get(Calendar.YEAR);
         public void init()
              mainPanel.add(dateLabel);
              setContentPane(mainPanel);
              dateLabel.append(currentCalendar.get(Calendar.HOUR) + currentCalendar.get
                        (Calendar.MINUTE);
    }

    As for what's wrong with the code, it would be easier if you said: it doesn't show the date (it does this instead), it doesn't compile (I get this message) etc.
    Anyway I'll assume you want to display the time in a label...
    dateLabel.append(currentCalendar.get(Calendar.HOUR) + currentCalendar.get
    (Calendar.MINUTE);This won't compile: the parentheses are mismatched, and there is simply no such thing as append(). So we could trydateLabel.setText("" + currentCalendar.get(Calendar.HOUR) + currentCalendar.get(Calendar.MINUTE));This wroks, but looks pretty nasty and it's not how you are supposed to format dates and times. Here's the unofficial party line, nicked from one of jverd's posts:
    Calculating Java dates: Take the time to learn how to create and use dates
    Formatting a Date Using a Custom Format
    Parsing a Date Using a Custom Format
    From those links you should be able to find those applicable to times like this: http://www.exampledepot.com/egs/java.text/FormatTime.html
    Using this approach you would end up with something like:import java.text.Format;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import javax.swing.JApplet;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    public class CurrentDateApplet extends JApplet
        private Date date;
        private JLabel timeLabel;
        private JPanel mainPanel;
        public void init()
            mainPanel = new JPanel();
            timeLabel = new JLabel();
            mainPanel.add(timeLabel);
            setContentPane(mainPanel);
            date = new Date();
            Format formatter = new SimpleDateFormat("HH:ss a");
            timeLabel.setText(formatter.format(date));
    }

  • My phone wont let me download anything even free stuff or update.it keep saying something wrong with my billing info so i fix it but still cant download.I signed out sign back in still nothing please help i'm getting angry

    My phone wont let me download anything even free stuff or update.it keep saying something wrong with my billing info so i fix it but still cant download.I signed out sign back in still nothing please help i'm getting angry

    If it says your billing info is wrong that means that your credit card issuer is refusing to approve your account. You will have to solve the problem with your bank or credit card company.

  • What is wrong with this code? on(release) gotoAndPlay("2")'{'

    Please could someone tell me what is wrong with this code - on(release)
    gotoAndPlay("2")'{'
    this is the error that comes up and i have tried changing it but it is not working
    **Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 2: '{' expected
         gotoAndPlay("2")'{'
    Total ActionScript Errors: 1 Reported Errors: 1
    Thanks

    If you have a frame labelled "2" then it should be:
    on (release) {
        this._parent.gotoAndPlay("2");
    or other wise just the following to go to frame 2:
    on (release) {
         this._parent.gotoAndPlay(2);
    You just had a missing curly bracket...

  • I have a Mid 2009 Macbook Pro 13 with no restore disk; it has OS 10.8.4 I believe there is something wrong with the OS due to I can not install flash player to view Youtube videos and the when we plug in a Bose headset the sound out will work sometimes

    I bough a used Macbook Pro mid 2009 that came with OS 10.8.9 it didn't have a backup restore disk with S/N W8******66D
    When trying to view some youtube videos; a window would pop up saying "it needs adobe flash player is required for video play back get the latest flash player" but after downloading the file and during installation would have errors and will not installed.....tried to reboot and install again.....but still the same.
    The othe thing I had noticed is when using a good Bose headset with mic the sound output would noticed the headset and then switch from headset to Internal speekers and headset.....thinking that there might be something wrong with the plug in port of the computer or the headset.....the headset works with no issues on my iPad so there must be something wrong with the computer.....tried to move the plugin around the port but no change....while the headset is plug in can hear a short clicking noise and the sound would get lost and back again......but with nothing plugin to the port there is no issue with the sound or mic.
    Thanks for your feed back......it looks like I have two different issues one is a software issue and the outher is a hardware issue
    <Edited By Host>

    The "restore disk" is built into the Mac. See About Recovery.
    Need more specifics about what error messages you got while installing Adobe Flash.
    However, you can almost avoid Flash altogether by setting YouTube to play the HTML5 version instead.
    Click the Try something new! link at the bottom of the YouTube page.
    I don't know about the sound issue. Might be hardware as you think. Try other headphones to check.

  • I'm not able to down load free apps without money on a credit card but the app is fee is this correct or is something wrong with my ipad

    I can not download apps that are free without money on a credit card. Is this right or is something wrong with my ipad

    Read here... https://discussions.apple.com/thread/5979741
    Keeka36 wrote:
    is something wrong with my ipad
    No.

  • There is something wrong with the volumes buttons in my macbook pro, every time i pressed the one who raises the volume, it leads me to the screen where (i do not no what its called) the background is black with the date and time and a calculator.

    There is something wrong with the volumes buttons in my macbook pro, every time i pressed the one who raises the volume, it leads me to the screen where (i do not no what its called) the background is black with the date and time and a calculator. However, when i lower it, my safari tab goes out of the screen. What do you guys think i should do? I'm getting very nervous.

    hey HAbrakian!
    You may want to try using the information in this article to adjust the behavior of your function keys to see if that resolves the behavior:
    Mac OS X: How to change the behavior of function keys
    http://support.apple.com/kb/ht3399
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • I can't figure out what's wrong with this code

    First i want this program to allow me to enter a number with the EasyReader class and depending on the number entered it will show that specific line of this peom:
    One two buckle your shoe
    Three four shut the door
    Five six pick up sticks
    Seven eight lay them straight
    Nine ten this is the end.
    The error message i got was an illegal start of expression. I can't figure out why it is giving me this error because i have if (n = 1) || (n = 2) statements. My code is:
    public class PoemSeventeen
    public static void main(String[] args)
    EasyReader console = new EasyReader();
    System.out.println("Enter a number for the poem (0 to quit): ");
    int n = console.readInt();
    if (n = 1) || (n = 2)
    System.out.println("One, two, buckle your shoe");
    else if (n = 3) || (n = 4)
    System.out.println("Three, four, shut the door");
    else if (n = 5) || (n = 6)
    System.out.println("Five, six, pick up sticks");
    else if (n = 7) || (n = 8)
    System.out.println("Seven, eight, lay them straight");
    else if (n = 9) || (n = 10)
    System.out.println("Nine, ten, this is the end");
    else if (n = 0)
    System.out.println("You may exit now");
    else
    System.out.println("Put in a number between 0 and 10");
    I messed around with a few other thing because i had some weird errors before but now i have narrowed it down to just this 1 error.
    The EasyReader class code:
    // package com.skylit.io;
    import java.io.*;
    * @author Gary Litvin
    * @version 1.2, 5/30/02
    * Written as part of
    * <i>Java Methods: An Introduction to Object-Oriented Programming</i>
    * (Skylight Publishing 2001, ISBN 0-9654853-7-4)
    * and
    * <i>Java Methods AB: Data Structures</i>
    * (Skylight Publishing 2003, ISBN 0-9654853-1-5)
    * EasyReader provides simple methods for reading the console and
    * for opening and reading text files. All exceptions are handled
    * inside the class and are hidden from the user.
    * <xmp>
    * Example:
    * =======
    * EasyReader console = new EasyReader();
    * System.out.print("Enter input file name: ");
    * String fileName = console.readLine();
    * EasyReader inFile = new EasyReader(fileName);
    * if (inFile.bad())
    * System.err.println("Can't open " + fileName);
    * System.exit(1);
    * String firstLine = inFile.readLine();
    * if (!inFile.eof()) // or: if (firstLine != null)
    * System.out.println("The first line is : " + firstLine);
    * System.out.print("Enter the maximum number of integers to read: ");
    * int maxCount = console.readInt();
    * int k, count = 0;
    * while (count < maxCount && !inFile.eof())
    * k = inFile.readInt();
    * if (!inFile.eof())
    * // process or store this number
    * count++;
    * inFile.close(); // optional
    * System.out.println(count + " numbers read");
    * </xmp>
    public class EasyReader
    protected String myFileName;
    protected BufferedReader myInFile;
    protected int myErrorFlags = 0;
    protected static final int OPENERROR = 0x0001;
    protected static final int CLOSEERROR = 0x0002;
    protected static final int READERROR = 0x0004;
    protected static final int EOF = 0x0100;
    * Constructor. Prepares console (System.in) for reading
    public EasyReader()
    myFileName = null;
    myErrorFlags = 0;
    myInFile = new BufferedReader(
    new InputStreamReader(System.in), 128);
    * Constructor. opens a file for reading
    * @param fileName the name or pathname of the file
    public EasyReader(String fileName)
    myFileName = fileName;
    myErrorFlags = 0;
    try
    myInFile = new BufferedReader(new FileReader(fileName), 1024);
    catch (FileNotFoundException e)
    myErrorFlags |= OPENERROR;
    myFileName = null;
    * Closes the file
    public void close()
    if (myFileName == null)
    return;
    try
    myInFile.close();
    catch (IOException e)
    System.err.println("Error closing " + myFileName + "\n");
    myErrorFlags |= CLOSEERROR;
    * Checks the status of the file
    * @return true if en error occurred opening or reading the file,
    * false otherwise
    public boolean bad()
    return myErrorFlags != 0;
    * Checks the EOF status of the file
    * @return true if EOF was encountered in the previous read
    * operation, false otherwise
    public boolean eof()
    return (myErrorFlags & EOF) != 0;
    private boolean ready() throws IOException
    return myFileName == null || myInFile.ready();
    * Reads the next character from a file (any character including
    * a space or a newline character).
    * @return character read or <code>null</code> character
    * (Unicode 0) if trying to read beyond the EOF
    public char readChar()
    char ch = '\u0000';
    try
    if (ready())
    ch = (char)myInFile.read();
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    if (ch == '\u0000')
    myErrorFlags |= EOF;
    return ch;
    * Reads from the current position in the file up to and including
    * the next newline character. The newline character is thrown away
    * @return the read string (excluding the newline character) or
    * null if trying to read beyond the EOF
    public String readLine()
    String s = null;
    try
    s = myInFile.readLine();
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    if (s == null)
    myErrorFlags |= EOF;
    return s;
    * Skips whitespace and reads the next word (a string of consecutive
    * non-whitespace characters (up to but excluding the next space,
    * newline, etc.)
    * @return the read string or null if trying to read beyond the EOF
    public String readWord()
    StringBuffer buffer = new StringBuffer(128);
    char ch = ' ';
    int count = 0;
    String s = null;
    try
    while (ready() && Character.isWhitespace(ch))
    ch = (char)myInFile.read();
    while (ready() && !Character.isWhitespace(ch))
    count++;
    buffer.append(ch);
    myInFile.mark(1);
    ch = (char)myInFile.read();
    if (count > 0)
    myInFile.reset();
    s = buffer.toString();
    else
    myErrorFlags |= EOF;
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    return s;
    * Reads the next integer (without validating its format)
    * @return the integer read or 0 if trying to read beyond the EOF
    public int readInt()
    String s = readWord();
    if (s != null)
    return Integer.parseInt(s);
    else
    return 0;
    * Reads the next double (without validating its format)
    * @return the number read or 0 if trying to read beyond the EOF
    public double readDouble()
    String s = readWord();
    if (s != null)
    return Double.parseDouble(s);
    // in Java 1, use: return Double.valueOf(s).doubleValue();
    else
    return 0.0;
    Can anybody please tell me what's wrong with this code? Thanks

    String[] message = {
        "One, two, buckle your shoe",
        "One, two, buckle your shoe",
        "Three, four, shut the door",
        "Three, four, shut the door",
        "Five, six, pick up sticks",
        "Five, six, pick up sticks",
        "Seven, eight, lay them straight",
        "Seven, eight, lay them straight",
        "Nine, ten, this is the end",
        "Nine, ten, this is the end"
    if(n>0)
        System.out.println(message[n]);
    else
        System.exit(0);

  • HELP PLEASE - WHATS WRONG WITH THIS CODE

    Hi. I get this message coming up when I try to compile the code,
    run:
    java.lang.NullPointerException
    at sumcalculator.SumNumbers.<init>(SumNumbers.java:34)
    at sumcalculator.SumNumbers.main(SumNumbers.java:93)
    Exception in thread "main"
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)
    I am not sure whats wrong with the code. Any assistance would be nice. The code is below.
    package sumcalculator;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class SumNumbers extends JFrame implements FocusListener {
    JTextField value1;
    JTextField value2;
    JLabel equals;
    JTextField sum;
    JButton add;
    JButton minus;
    JButton divide;
    JButton multiply;
    JLabel operation;
    public SumNumbers() {
    SumNumbersLayout customLayout = new SumNumbersLayout();
    getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
    getContentPane().setLayout(customLayout);
    value1.addFocusListener(this);
    value2.addFocusListener(this);
    sum.setEditable(true);
    value1 = new JTextField("");
    getContentPane().add(value1);
    value2 = new JTextField("");
    getContentPane().add(value2);
    equals = new JLabel("label_1");
    getContentPane().add(equals);
    sum = new JTextField("");
    getContentPane().add(sum);
    add = new JButton("+");
    getContentPane().add(add);
    minus = new JButton("-");
    getContentPane().add(minus);
    divide = new JButton("/");
    getContentPane().add(divide);
    multiply = new JButton("*");
    getContentPane().add(multiply);
    operation = new JLabel();
    getContentPane().add(operation);
    setSize(getPreferredSize());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public void focusGained(FocusEvent event){
    try {
    float total = Float.parseFloat(value1.getText()) +
    Float.parseFloat(value2.getText());
    sum.setText("" + total);
    } catch (NumberFormatException nfe) {
    value1.setText("0");
    value2.setText("0");
    sum.setText("0");
    public void focusLost(FocusEvent event){
    focusGained(event);
    public static void main(String args[]) {
    SumNumbers window = new SumNumbers();
    window.setTitle("SumNumbers");
    window.pack();
    window.show();
    class SumNumbersLayout implements LayoutManager {
    public SumNumbersLayout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 711 + insets.left + insets.right;
    dim.height = 240 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+48,128,40);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+48,128,40);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+408,insets.top+48,56,40);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+488,insets.top+48,152,40);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+136,72,40);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+248,insets.top+136,72,40);}
    c = parent.getComponent(6);
    if (c.isVisible()) {c.setBounds(insets.left+368,insets.top+136,72,40);}
    c = parent.getComponent(7);
    if (c.isVisible()) {c.setBounds(insets.left+488,insets.top+136,72,40);}
    c = parent.getComponent(8);
    if (c.isVisible()) {c.setBounds(insets.left+176,insets.top+48,56,40);}
    }

    Thank you. How do i amend this? I have defined value1though.Yes, you did - but after the call to addFocusListener(...). It needs to be before it.
    BTW, you did the same thing with "value2.addFocusListener(this)" and "sum.setEditable(true)" on the next two lines. You're attempting to call a method on an object that doesn't exist yet (i.e., you haven't called new yet).

  • There is always a blue screen appears after the Apple logo during the booting process. And then everything is back to normal. What is this thing? Is there something wrong with my screen or something?

    There is always a blue screen appears after the Apple logo during the booting process. And then everything is back to normal. What is this thing? Is there something wrong with my screen or something?

    Nah - that's just the normal boot process.
    Clinton

  • [b]Does anybody know what is wrong with my code[/b]

    I cannot see what is wrong with this code but i can't get it to compile. when i try to compile it i get the
    "Exception in thread "main" java.lang.NoClassDefFoundError:
    Is this a problem with compiling or is it a code error?
    Here is my code
    public class IntCalc{
         int value;
         public IntCalc(){
              value = 0;
         public void add(int number)     {
              value = value + number;
         public void subtract(int number){
              value = value - number;
         public int getValue()     {
              return value;
    Message was edited by:
    SHIFTER

    Youd don't have a class file. Compile it first then run it. If your compiler isnt making the .class file tell me and ill give you a link to a realy good java compiler.

Maybe you are looking for

  • How to format the font in Cell when export to Excel file?

    Dear all, I am using the CRJ SDK 12 to export to Excel file, but i i want to format the font of Cells in Excel when exporting them. Can you help me to solve this issue? Thanks, Nha

  • Category with no period

    We have the necessity to load our budget with FDM over a HFM scenario which don't have the data over a month but over [YEAR] (the first generation) in the period value. In FDM for this I create a category with Yearly frequency, but how I can define t

  • Restrict GRN before Pre-payemnt

    Please help me with following requirement. I want to raise a Purchase Order for a certain material to a single vendor with a pre-payment of 40% (out of total PO value).  How do I make sure that until invoice for the Pre-payment is raised in SAP, that

  • System creating "duplicate" files

    I'm the network security analyst and "computer manager" of a company that uses windows, as/400, and mac's. I'm still learning the as/400 and mac's. Right now I've got a curious problem going thru the mac's here. The problem appears to be localized to

  • Configuring POWL for PO

    Hi All, I have configured PO in POWL and able to see tasks list in POWL.But when I am trying to open any PO workitem I am getting error. "There is no iView available for system "SAP_ERP_Common": object "SWF_WIOBN". For more information, contact your