Can't debug PHP with FB 4.5

Hi
I'm trying to debug PHP services with ZendDebugger
I install correctly the ZendDebugger with Appserv with this code in php.ini
[Zend]
zend_extension_ts=C:/AppServ/php5/ext/ZendDebugger.dll
zend_debugger.allow_hosts=192.168.0.2, 127.0.0.1
zend_debugger.expose_remotely=always
with phpinfo() function I can see that the debugger is installed
Setup my project firstable creating a PHP project in Flash Builder and then Change/Add Project type to Flex Project
Inside Debug Configurations Add a PHP Web Page and setup to my PHP Class
Connect the services and works fine but if set breakpoints inside my php file the debugger doesn't work
Anybody can help me
Thanks

I am having a similar problem.  I can't even debug a simple php file.   Breakpoints did work correctly for a little while.  But one day they just seemed to stop working.  Did you ever figure this one out?

Similar Messages

  • Can we use PHP with Portal.

    Hello !
    Can we use PHP with oracle portal.
    Can we make portlets in PHP and use it in oracle portal.
    If yes then how .
    Any kind of help will be appreciated .
    Regards
    Seemab

    thank U marianfromspringwood..
    one more doubt please tell it clearly,
    i had bought ipad 2 wifi 3g 32gb  AT&T model from sanfrancisco, do i need to activate my ipad2 in america it self
    by AT&T ,or can i activate it in india with airtel,vodafone,bsnl,idea,etc gsm service provider. and weather my ipad2 wil work correctly in india, and if i have any problem in future then can i get assistance from india only or should i send it to america..............??

  • Can not compile php with "-with-oracle=/usr/local/oracle"

    I work on Linux engine with a x86_64 architecture and use Oracle 10g 10.2.0.1 client for x86_64 linux
    so - when i try to compile php with the oracle argument (-with-oracle=/usr/local/oracle) i get everytime the same error:
    checking Oracle version... configure: error: Oracle needed libraries not found
    I think, maybe i have a problem because configure not found my "64 bit libraries"...
    Can someone help me? I am realy helpless...
    thx

    Did you really want the obsolete "oracle" driver - why not use --with-oci8?
    The user comments in http://www.php.net/oci8 have some good info on 64bit configuration.

  • Can't get PHP with GD / libjpeg to work

    I'm totally frustrated, I tried compiling PHP 5.2.6 with GD and JPEG/PNG support on my Dual 2 GHz PowerPC G5 since yesterday (installed the latest XCode version) but without success so far. I also did all necessary steps like recompiling apache2, libjpeg and libpng. I found lots of tutorials but none of them worked out. PNG support works fine, here's the info from phpinfo()
    GD Support enabled
    GD Version bundled (2.0.34 compatible)
    GIF Read Support enabled
    GIF Create Support enabled
    PNG Support enabled
    WBMP Support enabled
    XBM Support enabled
    But whenever I use --with-jpeg-dir=/usr/local/lib /that's the dir I compiled libjpeg to) when configuring php I get the following errors when executing the "make" command:
    lt -liconv -liodbc -lmysqlclient -lldap -llber -liconv -liconv -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lssl -lcrypto -lcurl -lz -lssl -lcrypto -lm -lxml2 -lz -licucore -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lssl -lcrypto -lz -lxml2 -lz -licucore -lm -lmysqlclient -lz -lm -liodbc -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxslt -lxml2 -lz -licucore -lm -o libs/libphp5.bundle && cp libs/libphp5.bundle libs/libphp5.so
    Undefined symbols:
    "_jpeg_destroy_compress", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    "_jpeg_resync_to_restart", referenced from:
    _jpeg_resync_to_restart$non_lazy_ptr in gd_jpeg.o
    "_jpeg_start_compress", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    "_jpeg_CreateDecompress", referenced from:
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    "_jpeg_set_defaults", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    "_jpeg_destroy", referenced from:
    _fatal_jpeg_error in gd_jpeg.o
    "_jpeg_destroy_decompress", referenced from:
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    "_jpeg_write_marker", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    "_jpeg_finish_decompress", referenced from:
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    "_jpeg_std_error", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    "_jpeg_read_header", referenced from:
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    "_jpeg_set_quality", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    "_jpeg_finish_compress", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    "_jpeg_write_scanlines", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    "_jpeg_start_decompress", referenced from:
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    "_jpeg_CreateCompress", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    "_jpeg_read_scanlines", referenced from:
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    "_jpeg_save_markers", referenced from:
    _php_gd_gdImageCreateFromJpegCtx in gd_jpeg.o
    "_jpeg_simple_progression", referenced from:
    _php_gd_gdImageJpegCtx in gd_jpeg.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make: *** [libs/libphp5.bundle] Error 1
    Can anyone help me? Maybe I need special CFLAGS for my machine? Thanks in advance.

    Rob-C wrote:
    I got the jpeg source files from http://www.ijg.org/files/and compiled it according to some tutorials I found on the net. I also installed it using the port command (used --with-jpeg-dir=/opt/local for php then), but whatever I did and whatever configuration I used I always get the same error.
    /opt huh? Why am I not surprised? Your first step should be to purge all traces of whatever "port" software you were using and delete any software you installed with it. If you don't want to do that, you'll have to contact them (fink or MacPorts/DarwinPorts or whatever they are now) for support. The port packages do work and seem to work well for the software they provide. The evidence I have seen indicates that if they don't provide the port, it won't work. Be prepared for very strange and unsolvable problems when compiling non-ports software using ports tools. Plus, you can't really ask for help from the non-ports community, because all that non-ports software works fine for us.
    PS: Sorry if I sound a bit harsh. I've just seen too many of these postings. At least I have located the culprit - Apple!. That information is over five years old. I'm going to file a bug report against it.
    But I will try to help with what I can for now...
    Tried it with
    env MACOSXDEPLOYMENTTARGET=10.5 CFLAGS="-O -g -arch ppc -arch i386" LDFLAGS="-arch ppc -arch i386"
    ./configure -prefix=/usr -sysconfdir=/etc -localstatedir=/var -mandir=/usr/share/man -disable-dependency-tracking
    and without the env command as well
    Unless you are distributing the software, you shouldn't need to include the cross compilation options. However, when linking several of these projects together (as in PHP) you do need to match the compilation options for all the code that is linked together. Use whatever settings you used when you built PHP.
    then
    cp /usr/share/libtool/config.sub .
    cp /usr/share/libtool/config.guess .
    ./configure --enable-shared --enable-static
    make
    sudo make install
    sudo ranlib /usr/local/lib/libjpeg.a
    It seems that libjpeg hasn't been updated in 10 years, so these instructions look OK, more or less. Try "--disable-static" instead of "--enable-static". If that fails, leave them both off and try to link against the default static libraries.

  • Can't create text with PHP using imagettftext [SOLVED]

    I think that after the upgrade of PHP to the modular one I can't create text using TTF fonts. Before I file a bug report could someone confirm if it works or not for them? I might just have screwed something in my box.
    This code should create a text image and display it in the browser (it assumes you have DejaVu fonts in the default directory):
    <?php
    // Set the content-type
    header("Content-type: image/png");
    // Create the image
    $im = imagecreatetruecolor(400, 30);
    // Create some colors
    $white = imagecolorallocate($im, 255, 255, 255);
    $grey = imagecolorallocate($im, 128, 128, 128);
    $black = imagecolorallocate($im, 0, 0, 0);
    imagefilledrectangle($im, 0, 0, 399, 29, $white);
    // The text to draw
    $text = 'Testing...';
    // Replace path by your own font path
    $font = '/usr/share/fonts/TTF/DejaVuSans.ttf';
    // Add some shadow to the text
    imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
    // Add the text
    imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
    // Using imagepng() results in clearer text compared with imagejpeg()
    imagepng($im);
    imagedestroy($im);
    ?>
    Could someone with an up to date php with GD enabled tell me if it works or him/her?
    Thanks.
    EDIT: Ok, I solved it. The error reporting is turned off by default now, so I was not getting any error. After turning it on I found out it was related to the open_basedir directive being enabled now in php.ini. Turning it off allowed me to access the TTF for drawing text.
    Last edited by Bogart (2007-11-01 00:43:33)

    Aha!  I figured it out.  I used File...Open As to open it as a Camera RAW file.  In the ACR editor, it was showing as 16-bit depth.  Changed it to 8-bit and saved it.  Now the Text tool works!
    Ken

  • I have ipad 2. Safari stopped working. Screen appears with light gray cover. Some websites show errors when debug is on. But how actually can I debug or fix it? Thank you.

    I have ipad 2. Safari stopped working. Screen appears with light gray cover and is frozen. Some websites show errors when debug is on.
    But how actually can I debug or fix it? Thank you.

    Here are a couple suggestions:
    1.  Go into Settings > Safari and Clear Cookies Clear Cache
    2.  Fully close Safari:  from your home screen, double tap your home button and the most recently used Apps will show up.  Hold your finger on the Safari App until all Apps start jiggling.  You'll see a minus sign on the upper left side of Safari.  Touch the minus and Safari will fully close.  Touch your home button again to stop apps from jiggline, then touch your home button again to return to your home page.
    3.  Reboot your iPad:  Press and hold BOTH the power and home buttons at the SAME time for at least 10 seconds (ignore the red slider) until the Apple Logo appears, then let go of both buttons and your iPad will restart, but no data or settings will be lost.
    After iPad comes back up, try Safari again, and you should be good to go.

  • Can't remote debug appliaction with jdeveloper10.1.3 deployed in JBoss 4.2

    can't remote debug appliaction with jdeveloper10.1.3 deployed in JBoss 4.2.2
    when i try to debugg with old version like jboss-4.0.3SP1 it is workking good
    but when i'm try to debugg with jboss-4.2.2.GA and add project newly libaray jboss client jars of this version i got error
    Exception in thread "main" java.lang.NoClassDefFoundError: in
    and the debugger stoped in URLClassLoader and throw NoClassDefFoundError exception, i think the reason is the client jars
    which jars should i add to project libarary to success remotely debugg application in jboss 4.2.2 GA ?

    Remote debugging with JBoss 4.2 is the same as for 4.0.
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3?topic=rem_p_servlet_general_html

  • Both AIRSDK 13/14 can't debug with iOS simulator !

    XCode 5.1.1 / Mac OSX 10.9.2 / iOS Simulator 7.1 or 7.0 or 6
    AIRSDK 13/14
    all can't debug in iOS Simulator
    error message:
    Unable to dvtFoundationBundle. Error:

    when you debug your ipa, run the application, and it will show the adobe alert
    but it did not show on iOS 7.03,iPhone 5s,just crashed
    my objective code:
    #import "FlashRuntimeExtensions.h"
    FREObject tryCall(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])
        FREObject retStr;
        FRENewObjectFromUTF8(1, (const uint8_t*)"", &retStr);
        return retStr;
    void ANEContextInit(void* extData, const uint8_t* ctxType, FREContext ctx, uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet)
        *numFunctionsToTest = 1;
        FRENamedFunction* func = (FRENamedFunction*) malloc(sizeof(FRENamedFunction) * *numFunctionsToTest);
        func[0].name = (const uint8_t*) "tryCall";
        func[0].functionData = NULL;
        func[0].function = &tryCall;
        *functionsToSet = func;
    void ANEInit(void** extDataToSet, FREContextInitializer * ctxInitializerToSet, FREContextFinalizer * ctxFinalizerToSet)
        *extDataToSet = NULL;
        *ctxInitializerToSet = &ANEContextInit;
    i think it just a empty and,what should i do?how can i fix this? thank you

  • ■■I can't debug the xml_xslt_content EJB sample in the examplesWebApp !!

    &#9632;&#9632;I can't debug the xml_xslt_content EJB sample in the examplesWebApp
    start the Example Server
    http://localhost:7001/console
    among the deployed EJB ,the xml_xslt_content EJB how to run
    Is the related jsp page in \bea\wlserver6.0\samples\examples\xml\xslt ?????
    in the
    \bea\wlserver6.0\config\examples\applications\examplesWebApp\WEB-INF\web.xml
    there are
    <taglib-location>
    /WEB-INF/lib/xmlx-tags.jar
    </taglib-location>
    </taglib>
    in line471
    but i did not find the xmlx-tags.jar
    in the \bea\wlserver6.0
    who can help me ??????????

    As this is your 3rd post on this subject, Please tell us what the problem is, I did reply to both your 1st and 2nd post, and whilst I agree that my 1st post did not give an adequate reply (I misunderstood the problem), I think my second reply was adequate and I did offer to help further if you had problems, (please remember that I have to work as well as trying to help other users on the forum).
    My 2nd reply was as follows:
    If you wish to use the IIS server then go to: http://www.microsoft.com/Web/
    and download the Microsoft web platform.
    This 2nd option here is best if you are using php or are a beginner -
    If you wish to use an apache server try: http://httpd.apache.org/download.cgi
    or for a fuller installation (server/mysql/php)
    http://www.wampserver.com/en/download.php
    Don't forget to get the documentation as well!
    HTH
    PZ
    Once you have one of these working (or have a problem with), then please return.
    Message was edited by: pziecina
    If there is anything you do not understand, or require help with please reply to the original post, but as David Powers says any abusive language will prevent me (and others), from replying (I did not see the previous moderated post).
    PZ

  • Urgently!!!I can't debug the xml_xslt_content EJB sample in the examplesWebApp !!

    I can't debug the xml_xslt_content EJB sample in the examplesWebApp !!
    start the Example Server
    http://localhost:7001/console
    among the deployed EJB ,the xml_xslt_content EJB how to run
    Is the related jsp page in \bea\wlserver6.0\samples\examples\xml\xslt ?????
    in the
    \bea\wlserver6.0\config\examples\applications\examplesWebApp\WEB-INF\web.xml
    there are
    <taglib-location>
    /WEB-INF/lib/xmlx-tags.jar
    </taglib-location>
    </taglib>
    in line471
    but i did not find the xmlx-tags.jar
    in the \bea\wlserver6.0
    who can help me ??????????

    As this is your 3rd post on this subject, Please tell us what the problem is, I did reply to both your 1st and 2nd post, and whilst I agree that my 1st post did not give an adequate reply (I misunderstood the problem), I think my second reply was adequate and I did offer to help further if you had problems, (please remember that I have to work as well as trying to help other users on the forum).
    My 2nd reply was as follows:
    If you wish to use the IIS server then go to: http://www.microsoft.com/Web/
    and download the Microsoft web platform.
    This 2nd option here is best if you are using php or are a beginner -
    If you wish to use an apache server try: http://httpd.apache.org/download.cgi
    or for a fuller installation (server/mysql/php)
    http://www.wampserver.com/en/download.php
    Don't forget to get the documentation as well!
    HTH
    PZ
    Once you have one of these working (or have a problem with), then please return.
    Message was edited by: pziecina
    If there is anything you do not understand, or require help with please reply to the original post, but as David Powers says any abusive language will prevent me (and others), from replying (I did not see the previous moderated post).
    PZ

  • Can you help me with mouse pressed method please?

    hi
    can you help me with my problem please, player label doesn't show up in the applet and the draw string method it doesn't draw any strings like X or O for the game I don't know what is the problem maybe it is with MousePressed method which is in Board class. I tried to write the code of the location many times I'm not sure if the problem comes from there.
    there is no error in my code, but it doesn't work.
    this is class Board which has the mouseListener
    class Board extends JPanel  implements MouseListener, MouseMotionListener
        private JLabel playerlabel; 
         private boolean play;
         private boolean start;
        private int turn; 
        private Square squares[][];
      private Player myplayer[][];
         public Board()
              setBackground( Color.WHITE );
              playerlabel = new JLabel( "X player first" );
              //playerlabel.setLayout(null);
         //     playerlabel.setLocation(500,500);
              add( playerlabel );
              play = true;
              turn = 1;
             squares = new Square[3][3];
             myplayer = new Player[3][3];
             int x = 40;
              int y = 40;
              for (int i=0; i<3; i++){
                   x = 40;
                   for (int j=0; j<3; j++){
                        Square s = new Square( x,y );
                        squares[i][j] = s;
                        x +=50;
                   y +=50;
                this.addMouseListener(this);
            this.addMouseMotionListener(this);
          public void mouseClicked( MouseEvent event ){}
          public void mouseMoved( MouseEvent event ){}
          public void mouseEntered( MouseEvent event ){}
          public void mouseExited( MouseEvent event ){}
          public void mousePressed( MouseEvent event )
          {int xPos = event.getX();
                  int yPos = event.getY();
                    if(play && turn ==1){
                    for (int i=0; i<3; i++){
                        for (int j=0; j<3; j++){
                             int x = squares[i][j].getX();
                             int y = squares[i][j].getY();
                             if(xPos> x && xPos<x+40&& yPos> y && yPos<y+40){
                                  if( squares[i][j].getOccupied() ==0 ){
                                       String ptext;
                                       ptext = "X";
                                       Player p = new Player(x, y,ptext);
                                       myplayer[i][j] = p;
                                       squares[i][j].setOccupied(1);
                                       playerlabel.setText( "O Player Turn" );
                                       turn = 2;
                                       repaint();
                                       Win();
                                  else{
                                       turn = 2;
                                       playerlabel.setText( "O Player Turn" );
                                       repaint();
              if ( play && turn ==2 )
    for (int i=0; i<3; i++){
                        for (int j=0; j<3; j++){
                             int x = squares[i][j].getX();
                             int y = squares[i][j].getY();
                             if(xPos> x && xPos<x+40&& yPos> y && yPos<y+40){
                                  if( squares[i][j].getOccupied() ==0 ){
                                       String ptext;
                                       ptext = "O";
                                       Player p = new Player(x, y,ptext);
                                       myplayer[i][j] = p;
                                       squares[i][j].setOccupied(2);
                                       playerlabel.setText( "X Player Turn" );
                                       turn = 1;
                                       repaint();
                                       Win();
                                  else{
                                       turn = 1;
                                       playerlabel.setText( "X Player Turn" );
                                       repaint();
          public void mouseReleased( MouseEvent event )
          public void mouseDragged( MouseEvent event )
         public void Win(){
              if(squares[0][0].getOccupied() == squares[0][1].getOccupied() &&squares[0][1].getOccupied()==squares[0][2].getOccupied() &&squares[0][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else if (squares[1][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[1][2].getOccupied() &&squares[1][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else      if(squares[2][0].getOccupied() == squares[2][1].getOccupied() &&squares[2][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
                   if(squares[0][0].getOccupied() == squares[0][1].getOccupied() &&squares[0][1].getOccupied()==squares[0][2].getOccupied() &&squares[0][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else if (squares[1][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[1][2].getOccupied() &&squares[1][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else      if(squares[2][0].getOccupied() == squares[2][1].getOccupied() &&squares[2][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              //Vertically win
               if (squares[0][0].getOccupied() == squares[1][0].getOccupied() &&squares[1][0].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else if (squares[0][1].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][1].getOccupied() &&squares[2][1].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else      if(squares[0][2].getOccupied() == squares[1][2].getOccupied() &&squares[1][2].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
               if (squares[0][0].getOccupied() == squares[1][0].getOccupied() &&squares[1][0].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else if (squares[0][1].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][1].getOccupied() &&squares[2][1].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else      if(squares[0][2].getOccupied() == squares[1][2].getOccupied() &&squares[1][2].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              //Diagonal win
                    if (squares[0][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else if (squares[0][2].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
               if (squares[0][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else if (squares[0][2].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
         }//end win
    public void setTurn(int t)
              turn = t;
              playerlabel.setText( "X Player Plays First" );
         public void paintComponent( Graphics g )
               super.paintComponent( g );
               this.setBackground( Color.WHITE );
              for (int i=0; i<3; i++){
                   for (int j=0; j<3; j++){
                        g.setColor( Color.BLACK );
                         g.drawRect( squares[i][j].getX(), squares[i][j].getY(), 50, 50 );     
               for (int i=0; i<3; i++){
                   for (int j=0; j<3; j++){
                         myplayer[i][j].draw(g);     
            //End of paintComponent   
    }and this is the whole code of my program.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    class Player{
         private int xCoordinate;
         private int yCoordinate;
        private String playerText;
      public   Player(int x, int y, String t)
            playerText = t;
            xCoordinate = x;
            yCoordinate = y;
        public void draw(Graphics g)
               g.drawString(playerText,  xCoordinate, yCoordinate);
         public void SetText(String t)
         { playerText = t;
    }//end player
    class Square
         private int x;
         private int y;
         private int occupied;
         public Square(int x1, int y1)
              x = x1;
              y= y1;
              occupied = 0;
         public void setX(int x1)
              x = x1;
         public int getX()
              return x;
         public void setY(int y1)
              y = y1;
         public int getY()
              return y;
         public void setOccupied(int o)
              occupied = o;
         public int getOccupied()
              return occupied;
    public class TicTac extends JApplet implements ActionListener
    { private JPanel panel;
         private JButton newgame;
         private Board B;
         public void init()
              B = new Board();
              add( B, BorderLayout.CENTER );
              panel = new JPanel();
               newgame = new JButton( "New Game" );
               panel.add( newgame);
               add( panel, BorderLayout.SOUTH );
               newgame.addActionListener(this);
              public void actionPerformed( ActionEvent ev)
               {     Object source = ev.getSource();
         if (source == newgame)
                    {remove(B);
                   repaint();
              B = new Board();
                   add( B, BorderLayout.CENTER );
         B.setTurn(1);
                   repaint();
                   validate();
            }//end class TicTac
    class Board extends JPanel  implements MouseListener, MouseMotionListener
        private JLabel playerlabel; 
         private boolean play;
         private boolean start;
        private int turn; 
        private Square squares[][];
      private Player myplayer[][];
         public Board()
              setBackground( Color.WHITE );
              playerlabel = new JLabel( "X player first" );
              //playerlabel.setLayout(null);
         //     playerlabel.setLocation(500,500);
              add( playerlabel );
              play = true;
              turn = 1;
             squares = new Square[3][3];
             myplayer = new Player[3][3];
             int x = 40;
              int y = 40;
              for (int i=0; i<3; i++){
                   x = 40;
                   for (int j=0; j<3; j++){
                        Square s = new Square( x,y );
                        squares[i][j] = s;
                        x +=50;
                   y +=50;
                this.addMouseListener(this);
            this.addMouseMotionListener(this);
          public void mouseClicked( MouseEvent event ){}
          public void mouseMoved( MouseEvent event ){}
          public void mouseEntered( MouseEvent event ){}
          public void mouseExited( MouseEvent event ){}
          public void mousePressed( MouseEvent event )
          {int xPos = event.getX();
                  int yPos = event.getY();
                    if(play && turn ==1){
                    for (int i=0; i<3; i++){
                        for (int j=0; j<3; j++){
                             int x = squares[i][j].getX();
                             int y = squares[i][j].getY();
                             if(xPos> x && xPos<x+40&& yPos> y && yPos<y+40){
                                  if( squares[i][j].getOccupied() ==0 ){
                                       String ptext;
                                       ptext = "X";
                                       Player p = new Player(x, y,ptext);
                                       myplayer[i][j] = p;
                                       squares[i][j].setOccupied(1);
                                       playerlabel.setText( "O Player Turn" );
                                       turn = 2;
                                       repaint();
                                       Win();
                                  else{
                                       turn = 2;
                                       playerlabel.setText( "O Player Turn" );
                                       repaint();
              if ( play && turn ==2 )
    for (int i=0; i<3; i++){
                        for (int j=0; j<3; j++){
                             int x = squares[i][j].getX();
                             int y = squares[i][j].getY();
                             if(xPos> x && xPos<x+40&& yPos> y && yPos<y+40){
                                  if( squares[i][j].getOccupied() ==0 ){
                                       String ptext;
                                       ptext = "O";
                                       Player p = new Player(x, y,ptext);
                                       myplayer[i][j] = p;
                                       squares[i][j].setOccupied(2);
                                       playerlabel.setText( "X Player Turn" );
                                       turn = 1;
                                       repaint();
                                       Win();
                                  else{
                                       turn = 1;
                                       playerlabel.setText( "X Player Turn" );
                                       repaint();
          public void mouseReleased( MouseEvent event )
          public void mouseDragged( MouseEvent event )
         public void Win(){
              if(squares[0][0].getOccupied() == squares[0][1].getOccupied() &&squares[0][1].getOccupied()==squares[0][2].getOccupied() &&squares[0][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else if (squares[1][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[1][2].getOccupied() &&squares[1][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else      if(squares[2][0].getOccupied() == squares[2][1].getOccupied() &&squares[2][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
                   if(squares[0][0].getOccupied() == squares[0][1].getOccupied() &&squares[0][1].getOccupied()==squares[0][2].getOccupied() &&squares[0][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else if (squares[1][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[1][2].getOccupied() &&squares[1][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else      if(squares[2][0].getOccupied() == squares[2][1].getOccupied() &&squares[2][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              //Vertically win
               if (squares[0][0].getOccupied() == squares[1][0].getOccupied() &&squares[1][0].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else if (squares[0][1].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][1].getOccupied() &&squares[2][1].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else      if(squares[0][2].getOccupied() == squares[1][2].getOccupied() &&squares[1][2].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
               if (squares[0][0].getOccupied() == squares[1][0].getOccupied() &&squares[1][0].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else if (squares[0][1].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][1].getOccupied() &&squares[2][1].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else      if(squares[0][2].getOccupied() == squares[1][2].getOccupied() &&squares[1][2].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              //Diagonal win
                    if (squares[0][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
              else if (squares[0][2].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 1)
              {playerlabel.setText("Player 1 X WON THE GAME!");
              play =false;          }
               if (squares[0][0].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][2].getOccupied() &&squares[2][2].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
              else if (squares[0][2].getOccupied() == squares[1][1].getOccupied() &&squares[1][1].getOccupied()==squares[2][0].getOccupied() &&squares[2][0].getOccupied() == 2)
              {playerlabel.setText("Player 2 O WON THE GAME!");
              play =false;          }
         }//end win
    public void setTurn(int t)
              turn = t;
              playerlabel.setText( "X Player Plays First" );
         public void paintComponent( Graphics g )
               super.paintComponent( g );
               this.setBackground( Color.WHITE );
              for (int i=0; i<3; i++){
                   for (int j=0; j<3; j++){
                        g.setColor( Color.BLACK );
                         g.drawRect( squares[i][j].getX(), squares[i][j].getY(), 50, 50 );     
               for (int i=0; i<3; i++){
                   for (int j=0; j<3; j++){
                         myplayer[i][j].draw(g);     
            //End of paintComponent   
            Edited by: mshadows on May 18, 2008 7:53 AM

    I was playing with this a little bit and came up with this game model, something that I'm sure can be improved upon greatly:
    TttXO.java
    an enum to encapsulate X vs O. I could use a boolean here since it has 2 states, but this seems more intuitive to me
    package dy08.m05.ttt;
    * tic tac toe encapsulation of X vs O
    * @author Pete
    public enum TttXO
        X, O
    }TttCell.java
    encapsulates an individual cell in the tictactoe grid.
    package dy08.m05.ttt;
    * Tic Tac Toe Game cell
    * can be occupied or not
    * can hold TttXO X or O or null 
    * @author Pete
    public class TttCell
        private boolean occupied = false;
        private TttXO xo = null;
        public TttCell()
         * sets a Square for either x or o
         * @param TttXO
         * @return true if successful, false if already occupied
        public boolean setXO(TttXO xo)
            if (occupied)
                return false;
            else
                occupied = true;
                this.xo = xo;
                return true;
        public void reset()
            occupied = false;
            xo = null;
        public boolean isOccupied()
            return occupied;
        public TttXO getXO()
            return xo;
        // used to test and debug the class
        public String toString()
            if (occupied)
                return xo.toString();
            else
                return "-";
    package dy08.m05.ttt;
    * Tic Tac Toe game model
    * @author Pete
    public class TttGameModel
        private TttCell[][] cellGrid = new TttCell[3][3];
        private boolean xTurn = true;
        private boolean win = false;
        public TttGameModel()
            for (int i = 0; i < cellGrid.length; i++)
                for (int j = 0; j < cellGrid.length; j++)
    cellGrid[i][j] = new TttCell();
    public void reset()
    xTurn = true;
    win = false;
    for (int i = 0; i < cellGrid.length; i++)
    for (int j = 0; j < cellGrid[i].length; j++)
    cellGrid[i][j].reset();
    public boolean isXTurn()
    return xTurn;
    public boolean isWin()
    return win;
    * @param row
    * @param col
    * @return true if valid move, false if game already over or cell occupied
    public boolean takeTurn(int col, int row)
    TttXO currentXO = TttXO.O;
    TttCell cell = cellGrid[row][col];
    if (win)
    return false;
    if (cell.isOccupied())
    return false;
    if (xTurn)
    currentXO = TttXO.X;
    cell.setXO(currentXO);
    win = checkWin(col, row, currentXO);
    xTurn = !xTurn; // toggle xturn
    return true;
    public boolean checkWin(int col, int row, TttXO xo)
    boolean win = false;
    // first rows and columns
    boolean temp = true;
    for (int i = 0; i < 3; i++)
    temp &= cellGrid[row][i].getXO() == xo;
    win |= temp;
    temp = true;
    for (int i = 0; i < 3; i++)
    temp &= cellGrid[i][col].getXO() == xo;
    win |= temp;
    if (row == col) // if slash diagonal
    temp = true;
    for (int i = 0; i < 3; i++)
    temp &= cellGrid[i][i].getXO() == xo;
    win |= temp;
    if (row + col == 2) // if backslash diagonal
    temp = true;
    for (int i = 0; i < 3; i++)
    temp &= cellGrid[i][2 - i].getXO() == xo;
    win |= temp;
    return win;
    // used to test and debug the class
    public String toString()
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < cellGrid.length; i++)
    for (int j = 0; j < cellGrid[i].length; j++)
    sb.append(cellGrid[i][j] + " ");
    sb.append("\n");
    if (win)
    sb.append("win! Game over");
    else
    sb.append("No winner yet");
    return sb.toString();
    // test the class
    public static void main(String[] args)
    TttGameModel model = new TttGameModel();
    checkMove(model, 0, 0);
    checkMove(model, 1, 0);
    checkMove(model, 1, 1);
    checkMove(model, 2, 0);
    checkMove(model, 1, 0); // bad move
    checkMove(model, 2, 2);
    // to test the class
    private static void checkMove(TttGameModel model, int i, int j)
    System.out.println("OK move: " + model.takeTurn(i, j));
    System.out.println(model + "\n");

  • Can't connect PHP/MySQL 404 error

    Wow, the learning curve is killing me. Yet another challenge. I'm using Dreamweaver CC and this tutorial http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html
    I'm at this step:
    Open comments.php. You must have a PHP page open in the Document window to create a MySQL connection.
    In the Databases panel (choose Window > Databases), click the Plus button on the panel and select MySQL Connection.The MySQL Connection dialog box appears.
    Type connTest as the connection name.
    For the MySQL Server, type localhost.If you are using the MAMP default ports on a Mac, use localhost:8889.
    For the User Name, type phptestuser.
    Type the password you chose for the phptestuser account in the Password field.
    For the Database, type php_test.Note: You don't need to precede the underscore with a backslash here. It was inserted by phpMyAdmin in the previous section (see Figure 20) only because phpMyAdmin uses a query that permits wildcard characters.
    Click Test.Dreamweaver attempts to connect to the database. If the connection fails, do the following:
    Double-check the server name, user name, and password.
    Check the settings for the folder Dreamweaver uses to process dynamic pages (see Specifying a Testing Server for Dreamweaver).
    Verify that the web and MySQL servers are both running.
    Temporarily disable any firewall or security program. If the connection works, you need to configure the security program to permit communication between Dreamweaver and MySQL.
    Click OK. The new connection appears in the Databases panel.
    Expand the connTest connection, and then expand the Tables branch. You'll see the comments table in the database, which you can expand to reveal the details of the table columns (see Figure 23).
    As far as I can tell I have followed this tutorial to the letter.
    As far as I can tell, XAMPP/php mySQL are all running fine, the files are in the correct place and everything should be working. However when I hit test I get a 404 error. (Same error when I hit the select button.)
    The suggested problems on the 404 message are:
    1. There is no testing server running on the server machine.
    Pretty sure the testing server is running. Is there any way to test this, other than to note that xampp is definitely running right now and that I can log into phpMYadmin no problem?
    2. The testing server specified for this site does not map to the http://localhost/php_test/_MMServerScripts/MMHTTPDB.php URL Verify that the URL Prefix maps to the root of the site.
    Ummm...I'm pretty sure I put things where I was told to put them in the tutorial, but I'm lost at this point where I should verify what. A clue here? The files are where they are supposed to be, but maybe I entered something wrong? Except...I'm not sure what that could be or where to find it. Whatever IT is.
    Everything in local files is looking good.
    Thanks for your help!
    PS: Extra points to anyone who figures out how to make copy/pasteable error messages! These buggers are the bane of my life!

    Bgupta, you rock!
    I hope you have copied the "mysql.php" and "MMHTTPDB.php" files from "C:\Users\username\AppData\Roaming\Adobe\Dreamweaver CC\locale\Configuration\Connections\Scripts\PHP_MySQL\_mmDBScripts" to "C:\xampp\htdocs\phptest\_mmServerScripts"
    This was EXACTLY the problem. I checked the tutorial and I couldn't even find where the tutorial said to do this. (If I missed it, let me know where in the tutorial it was, please.)
    Fixed!

  • I need to download adobe reader 9 for windows 7. Can anyone provide me with a link?

    I need to download adobe reader 9 for windows 7. Can anyone provide me with a link?  Anyone have a link for Adobe reader 9?

    I know it was crazy hard to find the links!
    My company paid for it and I hadn't been on in a while...
    It took some serious bookmark/history crawling to find!
    Here they are though!
    This is the Applecare Service Source portal or ATT:
    http://www.info.apple.com/techtraining
    It'll forward you here (which might be different for other locales):
    http://www.info.apple.com/att/ssol/en/
    Also Self PAced Training (this is on the Service source page, but handy to have too):
    http://service.info.apple.com/service_training/en/home.php?page=training

  • Plsql debugging problem with jdeveloper

    hi
    i have an oracle server name tiger and a client machine the packages and stored procedure exists on the server machine. but when i try to debug i get the following error
    Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
    Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '0.0.0.0', '1421' )
    ORA-30683: failure establishing connection to debugger
    ORA-12545: Connect failed because target host or object does not exist
    ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
    ORA-06512: at line 1
    Process exited.
    amir

    I don't think JDev is able to debug with other application server. I can't see any server settings except embedded oc4j. you can only debug your application with embedded oc4j which JDev has. but you can create deployment profile for other server such as weblogic, jboss, and tomcat with JDev.
    -correct me if i'm wrong, thanks-

  • Using debug mode with jbuilder 4 (or other tool) and wl 6.0

    Hello,
    I would like to know if there is a way to use jbuilder environnement to
    debug ejb deployed on WL. I would like to be able to set break points into
    my source code and be able to display variables values.
    If it is not possible with jbuilder, is it possible with an other tool ?
    If not, how can you debug ejb ? For exemple if I want to be sure a specific
    line has been callde, do I need to stop my server, insert a system.out,
    redeploy my ejb and restart my WL or is there a more simple way to do it ?
    Thank's.
    Nicolas.

    Hello,
    I would like to know if there is a way to use jbuilder environnement to
    debug ejb deployed on WL. I would like to be able to set break points into
    my source code and be able to display variables values.
    If it is not possible with jbuilder, is it possible with an other tool ?
    If not, how can you debug ejb ? For exemple if I want to be sure a specific
    line has been callde, do I need to stop my server, insert a system.out,
    redeploy my ejb and restart my WL or is there a more simple way to do it ?
    Thank's.
    Nicolas.

Maybe you are looking for

  • Problem using external database link.

    Help: Here is th problem I am having. I have a workflow that reads and writes to external datasource using HS services. The workflow reads and then writes to the HS datasource in a function. After the function completes it needs to close the database

  • Data flow in SAP XI

    Any one there , will provide me the Data flow in SAP XI , thanking you sridhar

  • Need the classes for fm REUSE_ALV_HIERSEQ_LIST_DISPLAY  does.

    I have a requirement where  I need to display header and item using alv classes..  (the same functionality that REUSE_ALV_HIERSEQ_LIST_DISPLAY function module does).  If any one worked on this please guide.

  • Referencing cells in different documents.

    Is it possible to reference cells in a different document? This is very important for me and if it's not possible I'll have to go back and use Excel again.

  • Watch/Monitor Buttons do not show the correct state

    I programmed several Watch buttons on SPA500 module and some buttons stay lit red even though the phones are not used.  When pressing the button it does call the Vacant phone. How can I fix the state to be correct and only be lit red when the corrspo