Custom Error class is not recognized

Hi,
I have one main program testMyClass.java that uses MyException program to catch and process the errors.Due to some reason,when I compile testMyClass.java ,it
does not recognizes the MyException.
Any idea why this is happening.Any help in this regard is appreciated.
Thanks
Chat
testMyClass.java
import java.sql.*;
public class testMyClass {
     public testMyClass(){
     public void getConnection(String userName,String password){
          try{
          }catch(SQLException ee){
          throw MyException(ee+"this is Sql exception \n");}
          public static void main(String args[]){
               try{
                    testMyClass test1=new testMyClass();
                    test1.getConnection("myname","mypasswrd");
               }catch(MyException e){
                    System.out.println("you found the exception \n");
               }catch(Exception e){
MyException.java
public class MyException
extends Exception
private Exception hiddenException_;
public MyException(String error,Exception excp)
super(error);
hiddenException_ = excp;
public Exception getHiddenException()
return(hiddenException_);
Both classes are in a directory called test on c:\drive.
Below is the error that I get when I compile testMyClass.java
C:\mjava\test>javac testMyClass.java
testMyClass.java:14: cannot resolve symbol
symbol : method MyException (java.lang.String)
location: class testMyClass
throw MyException(ee+"this is Sql exception \n");}
^
testMyClass.java:24: cannot resolve symbol
symbol : class MyException
location: class testMyClass
}catch(MyException e){
^
2 errors

Hi,
I have made the change and still the error persists.
Thanks
Chat
import java.sql.*;
public class testMyClass {
        public testMyClass(){
        public void getConnection(String userName,String password){
           try{
           }catch(SQLException ee){
             throw new MyException(ee,"this is Sql exception");}
          public static void main(String args[]){
               try{
                    testMyClass test1=new testMyClass();
                    test1.getConnection("myname","mypasswrd");
                  }catch(MyException e){
                       System.out.println("you found the exception \n");
                  }catch(Exception e){
public class MyException
extends Exception
   private Exception hiddenException_;
   public MyException(String error,Exception excp)
      super(error);
      hiddenException_ = excp;
public Exception getHiddenException()
   return(hiddenException_);
C:\mjava\test>javac MyException.java
C:\mjava\test>javac testMyClass.java
testMyClass.java:14: cannot resolve symbol
symbol  : class MyException
location: class testMyClass
                   throw new MyException(ee,"this is Sql exception");}
                             ^
testMyClass.java:24: cannot resolve symbol
symbol  : class MyException
location: class testMyClass
                           }catch(MyException e){
                                  ^
2 errors

Similar Messages

  • Canon 7D Mark II error "Files are not recognized by the raw format support in Light (149)"?

    Has anyone tried to load raw files from a Canon 7D Mark II I get an error "Files are not recognized by the raw format support in Light (149)"?

    Based on previous experience, I expect the final versions of LR, ACR and DNGC to be released simultaneously.  We have so far seen Release Candidates of ACR and DNGC but not LR.
    Unless there needs to be a second ACR/DNGC Release Candidate which happens once every few years for special circumstances, which I don't see any of at the moment.

  • I get unexpectedly logged out from my mail box and and recieve the following message: "The custom error module does not recognize this error."

    I am repeatedly and unexpectedly logged-out from my mail box when working on a document. It frequently happens when I choose Send or Save, but it could happen any time. The file that I worked on disappears completely. Before, the file could be found in the draft box or some other place categorized as Auto Recovery. Now, instead, I get the following message: "The custom error module does not recognize this error." I am working at home, connected to a university server. The same problem appears with both of my computers, which are connected by a router. I have a MacBook Pro and am working with Firefox 6.0.2. I have a wireless broadband connection with Internet. AirPort is connected to Lindstrom and has IP address 192.168.0.198. Router: D-Link Model DIR-635. Modem: ZyXEL Model No. 660H D Triple Play Modem.
    Best wishes,
    Lars Lindström, Professor
    <[email protected]>

    Hi Phil,
    Generally, when a user sends an incoming request to an Exchange 2010 Client Access server using Outlook Web App and the user’s mailbox is on an Exchange 2010 mailbox in a different Active Directory site,
    Exchange 2010 determines whether the Client Access server has the
    ExternalURL property set in that Active Directory site. If it is and the cross-site silent redirection has been enabled, the user will be automatically redirected to the specified URL.
    Thus, please make sure the External URL property is set properly in your environment. And also
    disable the WindowsAuthentication for OWA VD to have a try. If the issue persists, please try the following KB to reset the Outlook Web Access-related virtual directories:
    http://support.microsoft.com/kb/941201
    Thanks,
    Winnie Liang
    TechNet Community Support
    Sorry for the late reply.  Yes, the ExternalURL is set; otherwise, it wouldn't work at all.  98% of the time everything is fine.
    My issue described a problem that appears only during session timeouts.  I've pretty much verified that this is the case; Exchange 2010 does not appropriately handle the timeouts sometimes when using cross-site redirection.

  • LSO_CHECK_BOOKING custom error messages are not displayed

    Hi,
    Good day! I am currently experiencing some problems displaying custom error messages from BADI LSO_CHECK_BOOKING. I have implemented this Badi and is appending error messages in CT_MESSAGE_TAB however when the message is displayed in portal, the custom message is not displayed. Instead, SAP displays a predefined error "Error When Creating Prebooking with the data entered..."
    Is there a way for me to display my custom error message instead of the predefined SAP message?
    Thanks a lot.
    Cheers,
    James

    Hi James,
    You have not mentioned, which portal you are using. Please see below, that there are differences in the learning and the admin portal:
    Learning Portal:
    The framework of the existing design of the Learning Portal does not
    allow customer specific error messages to be displayed in the portal.
    Only a generic message will be displayed when prebooking in the learning
    portal if the BADI LSO_CHECK_BOOKING returns an error. The design of the
    application does not expect to raise an exception from the BADI. If the
    BADI processing is assumed to be unsuccessful, the messages filled by
    the BADI will be ignored and a general error message will be displayed
    in the portal.
    So this is basically a design limitation.
    Administrator Portal:
    Have you tried e.g. the following notes?
    SAP Note 1806593 Admin Portal: Message is not displayed while prebooking
    SAP Note 1575238 LSO: BADI LSO_CHECK_BOOKING does not show warning messages
    Regards,
    Agnes

  • Windows AD login error: Account Information Not Recognized: Internal error.

    I follow this documentation and everything is working fine.
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0edd98d-c43e-2b10-e09a-e0a89931cedc
    1. create a domain user called bossosvcacct
    3. I was able to mapped group into the CMC and I do see user being mapped into the system.
    4. I did a test to make sure the kerbose is working correctly by running kinit username
    I got everything working except for when I login I'm getting this error.
    Account Information Not Recognized: Internal error.
    This is what is in my log.
    Commit Succeeded
    Debug is  true storeKey false useTicketCache false useKeyTab false doNotPrompt false ticketCache is null isInitiator true KeyTab is null refreshKrb5Config is false principal is null tryFirstPass is false useFirstPass is false storePass is false clearPass is false
              [Krb5LoginModule] user entered username: johndoeDOMAIN
    Acquire TGT using AS Exchange
    principal is johndoeDOMAIN
    EncryptionKey: keyType=23 keyBytes (hex dump)=0000: 17 29 81 67 E0 91 65 B3   61 D6 1E D9 DF BB 65 F0  .).g..e.a.....e.
    Commit Succeeded

    What do you get if you login to client tools (deski/designer/CCM)?
    commit succeeded is only the kinit part of the login, the CMS then needs to make a TGS request using the CMS service account. logging in with the client also requires this and is a good test. If clients work then the only known issues are for multi-domain/multi forest or encrypti0on mismatches between the service account and java configuration.
    Let us know...
    Regards,
    Tim

  • Error: Class could not be found.

    I was trying the JNI tutorial, copied and pasted the HelloWorld.java program, compiled it. Then when I was trying to run the javah -jni command, it gave me this error "Error: Class HelloWorld could not be found". I am 100% sure that the class file was in the folder. Anyone else have this problem?
    Thanks!

    I got it.... by adding -classpath .

  • Open Script Record Error - Browser is not recognized or recorded by tool

    Hi,
    I have installed the trial version of OpenScript 9.0 for performing R & D Activities in various features of it.
    The installation was completed successful. But when I click “Record” button the browser gets launched. But when I type the URL and navigate on the browser it is not recognized or recorded by the tool. Please help me on this.
    Regards
    Shan

    Hi,
    - maybe try to reinstal openscript ?
    - you have any messages in Console that could help ?
    - nothing recorded at all in Run ?
    because for me it worked nice on first shot with IE on :
    - xp sp3
    - xp sp3 VM remote
    - vista
    i did not try FF.
    Michael.

  • My iPod classis is not recognized by my Macbook and self-ejects immediately after being plugged in?

    Hello,
    I have an iPod classic and I am using a Macbook Pro running Mavericks. Since the last iTunes update i have not been able to connect my iPod to iTunes. I have tried both USB ports and it still won't work. The iPod ejects itself immediately after being plugged in. The usb ports are working, I've tried an iPod touch and an iPhone 4s, so that doesn't seem to be the issue either. Appreciate any help!

    Hi luisxjim,
    Thanks for using Apple Support Communities.  This article has some steps that may help if your iPod classic isn't being recognized by your computer:
    iPod not recognized in iTunes and Mac desktop
    http://support.apple.com/kb/TS1410
    Cheers,
    - Ari

  • ASP Error: Class does not support Automation

    Hi,
    I am trying to schedule a Webi report thru SDK using classic ASP.  I am using the sample code provided here...
    http://devlibrary.businessobjects.com/businessobjectsxir2/en/en/BOE_SDK/boesdk_com_doc/doc/boesdk_com_doc/Tutorials48.html
    Inside ScheduleWebiReport.asp, there's the subroutine below...
    Sub ScheduleWebiReport(iStore, webiID, format)
        Dim webiDocs
        Set webiDocs = iStore.Query("Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_ID=" & webiID)
        If (webiDocs.Count = 0) Then
            redirectWithError "../Error.asp", "The Web Intelligence document does not exist."
        End If
        Dim webiDoc
        Set webiDoc = webiDocs.Item(1).PluginInterface("")        
        Dim scheduleInfo
        'Creates an interface to the scheduling options for the Webi report.
        Set scheduleInfo = webiDoc.SchedulingInfo
        ' Runs the Webi report once.
        scheduleInfo.Type = 0
        ' Runs it right now.
        scheduleInfo.RightNow = True
        ' Set the scheduled format
        webiDoc.WebiFormatOptions.Format = format
        iStore.Schedule(webiDocs)   
    End Sub
    Whenever I reach the line: Set webiDoc = webiDocs.Item(1).PluginInterface("") (bolded above), I always get the error below...
    Microsoft VBScript runtime error '800a01ae'
    Class doesn't support Automation
    Has anyone encounter this issue or no how to fix this?
    Thanks in advance.

    Hi,
    I am trying to schedule a Webi report thru SDK using classic ASP.  I am using the sample code provided here...
    http://devlibrary.businessobjects.com/businessobjectsxir2/en/en/BOE_SDK/boesdk_com_doc/doc/boesdk_com_doc/Tutorials48.html
    Inside ScheduleWebiReport.asp, there's the subroutine below...
    Sub ScheduleWebiReport(iStore, webiID, format)
        Dim webiDocs
        Set webiDocs = iStore.Query("Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_ID=" & webiID)
        If (webiDocs.Count = 0) Then
            redirectWithError "../Error.asp", "The Web Intelligence document does not exist."
        End If
        Dim webiDoc
        Set webiDoc = webiDocs.Item(1).PluginInterface("")        
        Dim scheduleInfo
        'Creates an interface to the scheduling options for the Webi report.
        Set scheduleInfo = webiDoc.SchedulingInfo
        ' Runs the Webi report once.
        scheduleInfo.Type = 0
        ' Runs it right now.
        scheduleInfo.RightNow = True
        ' Set the scheduled format
        webiDoc.WebiFormatOptions.Format = format
        iStore.Schedule(webiDocs)   
    End Sub
    Whenever I reach the line: Set webiDoc = webiDocs.Item(1).PluginInterface("") (bolded above), I always get the error below...
    Microsoft VBScript runtime error '800a01ae'
    Class doesn't support Automation
    Has anyone encounter this issue or no how to fix this?
    Thanks in advance.

  • Custom component class is not detecting url parameter

    I have a hcsp page, on which i have a link something like this :
    "<$HttpCgiPath$>?IdcService=CUSTOM_SERVICE&var1=value1"
    m appending one more parameter in this url through java script.
    so one is the var1 which is directly here in the url and one m appending through java script so my final url would be:
    "<$HttpCgiPath$>?IdcService=CUSTOM_SERVICE&var1=value1&var2=value2"
    M calling a java function which fetches these variable.
    my code is
    String value1=m_binder.getlocal("var1");
    This is working fine .
    But when i do it for var2, this gives an error " variable var2 is not found" in the logs.
    Please guide
    Thanks,
    Chely
    Edited by: Chely on Jan 17, 2013 3:08 AM
    Edited by: Chely on Jan 17, 2013 3:09 AM

    Thanks Jonathan. i have executed m_binder.toString() and in the logs:
    m_binderString
    *** LocalData ***
    (9 keys + 0 defaults)
    IdcService=SUNRISE_DEL_TAX_USER
    XmlEncodingMode=Full
    dUser=UCMDev_Idc
    idcToken=1358675908923:318447AB701D7A6E92FDDAFA9DEBCC3D
    var1=1
    tax_type=N
    uname=cbohra001c
    *** RESULT SETS ***
    var1 is here but var2 is not here in the result set, Now what should i do to make it available in my binder,because in my hcsp java script i have an alert of url and in this alert i am able to see the complete url including var1 and var2.
    Thanks,
    Chely
    Edited by: Chely on Jan 18, 2013 2:06 AM

  • Error: USB Headset not recognized

    HP Pavilion dv7 Notebook PC  WV703AV
    OS: Windows 7 Home Premium - 64bytes
    Error: No error... just not working
    Hello, I just bought an USB headset SOMIC and after plugging it to the PC I realize it wasn't working. At the beginning I got mad thinking that it was about the headset, however after testing it in several computers with different Operative Systems(windows 7 x64, windows XP x32 & x64) I realize that actually they worked perfectly... so whats is coming on with my PC? - I thought.
    I tried by doing the following:
        1st - Changing it of USB Port - I tried the 4 of them.
        2nd - Updating the sound Drivers.
        3rd - Installing the Headset's drivers.
        4th - Downloading & Reinstalling the sound drivers.
        5th - Disabling the computers drivers in order to only use the headset's drivers.
    I am getting so angry that I am planning to reinstall my OS, however before doing it I would like to know if you could help me in this matter . It is clear that it is ABOUT THE USB CONDITION OF THE HEADSET as I have others with normal connectors and they work perfectly. Moreover, I JUST REALIZE that AUDIO BEATS monitor the sound settings and it has NO USB CONNECTOR COMPATIBILITY (only HDMI or NORMAL MALE CONNECTORS).
    So I tried disabling/uninstalling HP BEATS however it doesn't appear anywhere. Now I dont know what can I do to sort out this issue I am having please help me before I burned my PC . Pleasee I really need your help.
    I look forward to hearing from you, thanks in advance.
    Santiago.

    I too have this problem. Bump.

  • Ipad error usb device not recognized

    I can hook up my Itouch to computer and Itunes, I have the latest Itunes updates. Turned off both systems and still get error message. Go to device manager and puts it as a mass storage device and it needs software to continue. This is Ipad 1.

    Try to put the devices into Recovery, Note:This Will Erase all the devices data; Power down the device, hold the devices home key will plugging into itunes, then go to device and click restore.
    Hope this works

  • I am getting an error: email server not recognizing my username/password combo

    I am trying to email some pictures from iPhoto and I am receiving an error that the email server doesn't recognize my username/password.  I have delted all email accounts in iPhoto Preferences and reentering them but I am still getting same error?  Any ideas

    Then set Mail as the email client in the iPhoto preferences
    LN

  • "Class Circle not found in TryBouncingBalls" error message. Help !

    Dear People,
    I have an error message :
    "TryBouncingBalls.java": Error : class Circle not found in class stan_bluej_ch5_p135.TryBouncingBalls at line 67, "
    Circle circle = new Circle(xPos + 130, 30);
    below are the classes TryBouncingBalls, BouncingBall, BallDemo, Canvas
    Thank you in advance
    Stan
    package stan_bluej_ch5_p135;
    import java.awt.*;
    import java.awt.geom.*;
    public class TryBouncingBalls
    public static void main(String[] args)
    Canvas myCanvas = new Canvas("Creativity at its best");
    myCanvas.setVisible(true);
    BouncingBall ball = new BouncingBall(50,50,16, Color.red, 500, myCanvas);
    BouncingBall ball2 = new BouncingBall(70,80,20, Color.green, 500, myCanvas);
    BouncingBall ball3 = new BouncingBall(90,100,16, Color.red, 500, myCanvas);
    BouncingBall ball4 = new BouncingBall(30,30,20, Color.green, 500, myCanvas);
    ball.draw();
    ball2.draw();
    ball.draw();
    ball2.draw();
    // make them bounce
    boolean finished = false;
    while(!finished) {
    myCanvas.wait(50); // small delay
    ball.move();
    ball2.move();
    ball3.move();
    ball4.move();
    // stop once ball has travelled a certain distance on x axis
    if(ball.getXPosition() >= 550 && ball2.getXPosition() >= 550)
    finished = true;
    myCanvas.setFont(new Font("helvetica", Font.BOLD, 14));
    myCanvas.setForegroundColor(Color.red);
    myCanvas.drawString("We are having fun, ...\n\n", 20, 30);
    myCanvas.wait(1000);
    myCanvas.setForegroundColor(Color.black);
    myCanvas.drawString("...drawing lines...", 60, 60);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.gray);
    myCanvas.drawLine(200, 20, 300, 50);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.blue);
    myCanvas.drawLine(220, 100, 370, 40);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.green);
    myCanvas.drawLine(290, 10, 320, 120);
    myCanvas.wait(1000);
    myCanvas.setForegroundColor(Color.gray);
    myCanvas.drawString("...and shapes!", 110, 90);
    myCanvas.setForegroundColor(Color.red);
    myCanvas.drawString("to bring to focus creative ideas !", 310, 290);
    // the shape to draw and move
    int xPos = 10;
    Rectangle rect = new Rectangle(xPos + 40, 150, 30, 20);
    Rectangle rect2 = new Rectangle(xPos + 80, 120, 50, 25);
    Rectangle rect3 = new Rectangle(xPos+ 1200, 180, 30, 30);
    Rectangle rect4 = new Rectangle(xPos + 150, 220, 40, 15);
    myCanvas.fill(rect);
    myCanvas.fill(rect2);
    myCanvas.fill(rect3);
    myCanvas.fill(rect4);
    Circle circle = new Circle(xPos + 130, 30);
    // Circle circle2 = new Circle(xPos + 150, 50);
    // Circle circle3 = new Circle(xPos + 170, 30);
    // Circle circle4 = new Circle(xPos + 200, 40);
    // myCanvas.fill(circle);
    // myCanvas.fill(circle2);
    // myCanvas.fill(circle3);
    // myCanvas.fill(circle4);
    // move the rectangle and circles across the screen
    for(int i = 0; i < 200; i ++) {
    myCanvas.fill(rect);
    myCanvas.fill(rect2);
    myCanvas.fill(rect3);
    myCanvas.fill(rect4);
    myCanvas.wait(10);
    myCanvas.erase(rect);
    myCanvas.erase(rect2);
    myCanvas.erase(rect3);
    myCanvas.erase(rect4);
    xPos++;
    rect.setLocation(xPos, 150);
    rect2.setLocation(xPos, 120);
    rect3.setLocation(xPos, 180);
    rect4.setLocation(xPos, 220);
    // at the end of the move, draw once more so that it remains visible
    myCanvas.fill(rect);
    myCanvas.fill(rect2);
    myCanvas.fill(rect3);
    myCanvas.fill(rect4);
    package stan_bluej_ch5_p135;
    import java.awt.*;
    import java.awt.geom.*;
    * Class BouncingBall - a graphical ball that observes the effect of gravity. The ball
    * has the ability to move. Details of movement are determined by the ball itself. It
    * will fall downwards, accelerating with time due to the effect of gravity, and bounce
    * upward again when hitting the ground.
    * This movement can be initiated by repeated calls to the "move" method.
    * @author Bruce Quig
    * @author Michael Kolling (mik)
    * @author David J. Barnes
    * @version 1.1 (23-Jan-2002)
    public class BouncingBall
    private static final int gravity = 3; // effect of gravity
    private int ballDegradation = 2;
    private Ellipse2D.Double circle;
    private Color color;
    private int diameter;
    private int xPosition;
    private int yPosition;
    private final int groundPosition; // y position of ground
    private Canvas canvas;
    private int ySpeed = 1; // initial downward speed
    * Constructor for objects of class BouncingBall
    * @param xPos the horizontal coordinate of the ball
    * @param yPos the vertical coordinate of the ball
    * @param ballDiameter the diameter (in pixels) of the ball
    * @param ballColor the color of the ball
    * @param groundPos the position of the ground (where the wall will bounce)
    * @param drawingCanvas the canvas to draw this ball on
    public BouncingBall(int xPos, int yPos, int ballDiameter, Color ballColor,
    int groundPos, Canvas drawingCanvas)
    xPosition = xPos;
    yPosition = yPos;
    color = ballColor;
    diameter = ballDiameter;
    groundPosition = groundPos;
    canvas = drawingCanvas;
    * Draw this ball at its current position onto the canvas.
    public void draw()
    canvas.setForegroundColor(color);
    canvas.fillCircle(xPosition, yPosition, diameter);
    * Erase this ball at its current position.
    public void erase()
    canvas.eraseCircle(xPosition, yPosition, diameter);
    * Move this ball according to its position and speed and redraw.
    public void move()
    // remove from canvas at the current position
    erase();
    // compute new position
    ySpeed += gravity;
    yPosition += ySpeed;
    xPosition +=2;
    // check if it has hit the ground
    if(yPosition >= (groundPosition - diameter) && ySpeed > 0) {
    yPosition = (int)(groundPosition - diameter);
    ySpeed = -ySpeed + ballDegradation;
    // draw again at new position
    draw();
    * return the horizontal position of this ball
    public int getXPosition()
    return xPosition;
    * return the vertical position of this ball
    public int getYPosition()
    return yPosition;
    package stan_bluej_ch5_p135;
    import java.awt.*;
    import java.awt.geom.*;
    * Class BallDemo - provides two short demonstrations showing how to use the
    * Canvas class.
    * @author Michael Kolling and David J. Barnes
    * @version 1.0 (23-Jan-2002)
    public class BallDemo
    private Canvas myCanvas;
    * Create a BallDemo object. Creates a fresh canvas and makes it visible.
    public BallDemo()
    myCanvas = new Canvas("Ball Demo", 600, 500);
    myCanvas.setVisible(true);
    * This method demonstrates some of the drawing operations that are
    * available on a Canvas object.
    public void drawDemo()
    myCanvas.setFont(new Font("helvetica", Font.BOLD, 14));
    myCanvas.setForegroundColor(Color.red);
    myCanvas.drawString("We can draw text, ...", 20, 30);
    myCanvas.wait(1000);
    myCanvas.setForegroundColor(Color.black);
    myCanvas.drawString("...draw lines...", 60, 60);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.gray);
    myCanvas.drawLine(200, 20, 300, 50);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.blue);
    myCanvas.drawLine(220, 100, 370, 40);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.green);
    myCanvas.drawLine(290, 10, 320, 120);
    myCanvas.wait(1000);
    myCanvas.setForegroundColor(Color.gray);
    myCanvas.drawString("...and shapes!", 110, 90);
    myCanvas.setForegroundColor(Color.red);
    // the shape to draw and move
    int xPos = 10;
    Rectangle rect = new Rectangle(xPos, 150, 30, 20);
    // move the rectangle across the screen
    for(int i = 0; i < 200; i ++) {
    myCanvas.fill(rect);
    myCanvas.wait(10);
    myCanvas.erase(rect);
    xPos++;
    rect.setLocation(xPos, 150);
    // at the end of the move, draw once more so that it remains visible
    myCanvas.fill(rect);
    * Simulates two bouncing balls
    public void bounce()
    int ground = 400; // position of the ground line
    myCanvas.setVisible(true);
    // draw the ground
    myCanvas.drawLine(50, ground, 550, ground);
    // crate and show the balls
    BouncingBall ball = new BouncingBall(50, 50, 16, Color.blue, ground, myCanvas);
    ball.draw();
    BouncingBall ball2 = new BouncingBall(70, 80, 20, Color.red, ground, myCanvas);
    ball2.draw();
    // make them bounce
    boolean finished = false;
    while(!finished) {
    myCanvas.wait(50); // small delay
    ball.move();
    ball2.move();
    // stop once ball has travelled a certain distance on x axis
    if(ball.getXPosition() >= 550 && ball2.getXPosition() >= 550)
    finished = true;
    ball.erase();
    ball2.erase();
    package stan_bluej_ch5_p135;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.geom.*;
    * Class Canvas - a class to allow for simple graphical
    * drawing on a canvas.
    * @author Michael Kolling (mik)
    * @author Bruce Quig
    * @version 1.8 (23.01.2002)
    public class Canvas
    private JFrame frame;
    private CanvasPane canvas;
    private Graphics2D graphic;
    private Color backgroundColor;
    private Image canvasImage;
    * Create a Canvas with default height, width and background color
    * (300, 300, white).
    * @param title title to appear in Canvas Frame
    public Canvas(String title)
    this(title, 600, 600, Color.white);
    * Create a Canvas with default background color (white).
    * @param title title to appear in Canvas Frame
    * @param width the desired width for the canvas
    * @param height the desired height for the canvas
    public Canvas(String title, int width, int height)
    this(title, width, height, Color.white);
    * Create a Canvas.
    * @param title title to appear in Canvas Frame
    * @param width the desired width for the canvas
    * @param height the desired height for the canvas
    * @param bgClour the desired background color of the canvas
    public Canvas(String title, int width, int height, Color bgColor)
    frame = new JFrame();
    canvas = new CanvasPane();
    frame.setContentPane(canvas);
    frame.setTitle(title);
    canvas.setPreferredSize(new Dimension(width, height));
    backgroundColor = bgColor;
    frame.pack();
    * Set the canvas visibility and brings canvas to the front of screen
    * when made visible. This method can also be used to bring an already
    * visible canvas to the front of other windows.
    * @param visible boolean value representing the desired visibility of
    * the canvas (true or false)
    public void setVisible(boolean visible)
    if(graphic == null) {
    // first time: instantiate the offscreen image and fill it with
    // the background color
    Dimension size = canvas.getSize();
    canvasImage = canvas.createImage(size.width, size.height);
    graphic = (Graphics2D)canvasImage.getGraphics();
    graphic.setColor(backgroundColor);
    graphic.fillRect(0, 0, size.width, size.height);
    graphic.setColor(Color.black);
    frame.show();
    * Provide information on visibility of the Canvas.
    * @return true if canvas is visible, false otherwise
    public boolean isVisible()
    return frame.isVisible();
    * Draw the outline of a given shape onto the canvas.
    * @param shape the shape object to be drawn on the canvas
    public void draw(Shape shape)
    graphic.draw(shape);
    canvas.repaint();
    * Fill the internal dimensions of a given shape with the current
    * foreground color of the canvas.
    * @param shape the shape object to be filled
    public void fill(Shape shape)
    graphic.fill(shape);
    canvas.repaint();
    * Fill the internal dimensions of the given circle with the current
    * foreground color of the canvas.
    public void fillCircle(int xPos, int yPos, int diameter)
    Ellipse2D.Double circle = new Ellipse2D.Double(xPos, yPos, diameter, diameter);
    fill(circle);
    * Fill the internal dimensions of the given rectangle with the current
    * foreground color of the canvas. This is a convenience method. A similar
    * effect can be achieved with the "fill" method.
    public void fillRectangle(int xPos, int yPos, int width, int height)
    fill(new Rectangle(xPos, yPos, width, height));
    * Erase the whole canvas.
    public void erase()
    Color original = graphic.getColor();
    graphic.setColor(backgroundColor);
    Dimension size = canvas.getSize();
    graphic.fill(new Rectangle(0, 0, size.width, size.height));
    graphic.setColor(original);
    canvas.repaint();
    * Erase the internal dimensions of the given circle. This is a
    * convenience method. A similar effect can be achieved with
    * the "erase" method.
    public void eraseCircle(int xPos, int yPos, int diameter)
    Ellipse2D.Double circle = new Ellipse2D.Double(xPos, yPos, diameter, diameter);
    erase(circle);
    * Erase the internal dimensions of the given rectangle. This is a
    * convenience method. A similar effect can be achieved with
    * the "erase" method.
    public void eraseRectangle(int xPos, int yPos, int width, int height)
    erase(new Rectangle(xPos, yPos, width, height));
    * Erase a given shape's interior on the screen.
    * @param shape the shape object to be erased
    public void erase(Shape shape)
    Color original = graphic.getColor();
    graphic.setColor(backgroundColor);
    graphic.fill(shape); // erase by filling background color
    graphic.setColor(original);
    canvas.repaint();
    * Erases a given shape's outline on the screen.
    * @param shape the shape object to be erased
    public void eraseOutline(Shape shape)
    Color original = graphic.getColor();
    graphic.setColor(backgroundColor);
    graphic.draw(shape); // erase by drawing background color
    graphic.setColor(original);
    canvas.repaint();
    * Draws an image onto the canvas.
    * @param image the Image object to be displayed
    * @param x x co-ordinate for Image placement
    * @param y y co-ordinate for Image placement
    * @return returns boolean value representing whether the image was
    * completely loaded
    public boolean drawImage(Image image, int x, int y)
    boolean result = graphic.drawImage(image, x, y, null);
    canvas.repaint();
    return result;
    * Draws a String on the Canvas.
    * @param text the String to be displayed
    * @param x x co-ordinate for text placement
    * @param y y co-ordinate for text placement
    public void drawString(String text, int x, int y)
    graphic.drawString(text, x, y);
    canvas.repaint();
    * Erases a String on the Canvas.
    * @param text the String to be displayed
    * @param x x co-ordinate for text placement
    * @param y y co-ordinate for text placement
    public void eraseString(String text, int x, int y)
    Color original = graphic.getColor();
    graphic.setColor(backgroundColor);
    graphic.drawString(text, x, y);
    graphic.setColor(original);
    canvas.repaint();
    * Draws a line on the Canvas.
    * @param x1 x co-ordinate of start of line
    * @param y1 y co-ordinate of start of line
    * @param x2 x co-ordinate of end of line
    * @param y2 y co-ordinate of end of line
    public void drawLine(int x1, int y1, int x2, int y2)
    graphic.drawLine(x1, y1, x2, y2);
    canvas.repaint();
    * Sets the foreground color of the Canvas.
    * @param newColor the new color for the foreground of the Canvas
    public void setForegroundColor(Color blue)
    graphic.setColor(Color.blue);
    * Returns the current color of the foreground.
    * @return the color of the foreground of the Canvas
    public Color getForegroundColor()
    return graphic.getColor();
    * Sets the background color of the Canvas.
    * @param newColor the new color for the background of the Canvas
    public void setBackgroundColor(Color newColor)
    backgroundColor = newColor;
    graphic.setBackground(newColor);
    * Returns the current color of the background
    * @return the color of the background of the Canvas
    public Color getBackgroundColor()
    return backgroundColor;
    * changes the current Font used on the Canvas
    * @param newFont new font to be used for String output
    public void setFont(Font newFont)
    graphic.setFont(newFont);
    * Returns the current font of the canvas.
    * @return the font currently in use
    public Font getFont()
    return graphic.getFont();
    * Sets the size of the canvas.
    * @param width new width
    * @param height new height
    public void setSize(int width, int height)
    canvas.setPreferredSize(new Dimension(width, height));
    Image oldImage = canvasImage;
    canvasImage = canvas.createImage(width, height);
    graphic = (Graphics2D)canvasImage.getGraphics();
    graphic.drawImage(oldImage, 0, 0, null);
    frame.pack();
    * Returns the size of the canvas.
    * @return The current dimension of the canvas
    public Dimension getSize()
    return canvas.getSize();
    * Waits for a specified number of milliseconds before finishing.
    * This provides an easy way to specify a small delay which can be
    * used when producing animations.
    * @param milliseconds the number
    public void wait(int milliseconds)
    try
    Thread.sleep(milliseconds);
    catch (InterruptedException e)
    // ignoring exception at the moment
    * Nested class CanvasPane - the actual canvas component contained in the
    * Canvas frame. This is essentially a JPanel with added capability to
    * refresh the image drawn on it.
    private class CanvasPane extends JPanel
    public void paint(Graphics g)
    g.drawImage(canvasImage, 0, 0, null);

    Dear Miciuli,
    I found the definition for the circle in the canvas class and used it to creates circles ! Thank you for jaring my brain into thinking !
    Stan
    Ellipse2D.Double circle = new Ellipse2D.Double(xPos, 70, 30 , 30);

  • Account information not recognized: Could not reach CMS ' MachineName :6400'. The CMS on machine ' MachineName ' was stopped due to a critical error. (FWM 20031)

    I have just installed Information platform services 4.1 sp2 on a windows server 2008 R2 standard service pack 1. having 8 GB RAM.
    Central Configuration manager is in Running status but when I try to login to Cental management Console then I get following error
    "Account information not recognized: Could not reach CMS '<MachineName>:6400'. The CMS on machine '<MachineName>' was stopped due to a critical error. (FWM 20031)"
    I have CMS and AUDIT database on Oracle server and they are getting connected from my machine through SQL developer and the tables are also created under CMS and audit databases.
    I am not able to figure out what Issue is causing the Error. Below is the content of error_cms6400.log file located in the directory <E:\SAP Business Objects\SAP BusinessObjects Enterprise XI 4.0\logging>.
    33007
    CMS system database is overloaded, please try again. If the problem persists, please contact the system administrator(FWB 00027)
    35101
    The root server reported an error Initialization Failure. (Reason: CMS system database is overloaded, please try again. If the problem persists, please contact the system administrator(FWB 00027)CMS system database is overloaded, please try again. If the problem persists, please contact the system administrator(FWB 00027) CacheObjectIDs ).
    I have created New databases for CMS and audit and it is saying database is overloaded.
    Please help me rectify the Issue.
    Thanks in Advance

    Hi Ankur,
    As per the error message you entered the issue might occur because the Oracle CMS database reside in a different network or there is a network delay between BO server and database server. Please refer KBA 1706849 and try following steps.
    Confirm that the CMS database and BO server are in same network
    Try to ping database server from BO server and check the reply. The reply should come in 1 ms
    Confirm with DBA whether there are 14 connections established to CMS database
    Stop the SIA and restart your database schema. Then start the SIA and try login 
    Please let us know error messages in Event viewer if this is a Windows server and also is this a clustered environment ?
    Regards,
    Hrishikesh

Maybe you are looking for

  • Where does iweb store its gallery information?

    In which file does iWeb store the information which allows it to construct a gallery page? I have a site with a Gallery page, which I publish to a local folder, then upload to an ftp server for a live website (www.ayrmodelboatclub.org) When I update

  • How to change the date format in xml form?

    hi, How to change the date format in xml form? For example:  11/20/2008 3:00:03 PM    ->   11-20 03:00 Any opinions greatly appreciated! Thanks. Edited by: ke wenxing on Dec 2, 2008 8:33 AM

  • Combining multiple Character Styles

    I'd like to apply multiple character styles to the same words. However, this does not seem possible. One character styles always overrides the other. Please see the attached image for a visualization. I tried Shift-clicking both styles to apply them,

  • BT Sport, where did it go

    Had massive problems getting BT Sport set up, turns out there was a mix-up at the local exchange with IP addresses. So had BT Sport for a couple of months and now it has gone. Helpdesk asked me to reset etc then suggested that i use the 10M cable rat

  • Quicktime .mov files with MPEG-2 codec playback error

    I have a series of .mov files, and I'm not able to open them in QT X or QT 7.6.6. The codecs listed in the Info for the files are: MPEG-2, Linear PCM, and Timecode. Original format is MPEG HD, at 1920x1080. Does anyone know how I can play them back?