How to make a 3X3 Slider puzzle game?

Hey guys, im new here and decided to make an account on here. Im coming to you guys for help. In my grade 12 infotech class, we were assigned a project dealing with 2d arrays but im having a bit of trouble doing this :S. It needs to do the required:
1. Acquire an image
2. Divide image into NINE separate images
a. You will have a TENTH image that will represent the “removed” space
3. Create TWO 2-D Image arrays
a. One array will store the correct images as reference (use the array index as coordinates for the locations)
b. One array will store the images mixed up
4. Create ONE 2-D Boolean array
a. This array will store the location of where the empty tile is since you actually don’t delete the image
5. Create ONE 2-D Rectangle array
a. This array will store the information for the tiles (width, height, x-start, y-start) you are moving
6. Display the tiles in the right order for the correct image
7. Create a button that will remove a random image-tile
8. Allow the remaining pieces to be moved around (into the empty space) to mix up the picture
9. Keep track of number of moves made
10. Create a button that will indicate it’s the “Solver’s” turn
11. Keep track of number of steps made to solve the puzzle
12. Check if the pieces have been moved into the right locations
13. If the puzzle is completed, add back in the removed piece
14. Play sounds at appropriate times
this is what ive gotten so far.. sorry if its a strain on the eyes.
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class movingThingGame extends Applet implements ActionListener KeyListener {
     boolean[] keyUp;
     char Kp;
     //Store correct image co-ordinates
     Image[][] aImages;
     //Store mixed image co-ordinates
     Image[][] bImages;
     //Store location of blanked out image
     Boolean[][] cTile;
     //Store x,y,width,height
     Rectangle[][] dInfo;
     //Top Row
     Image zz; //0,0
     Image oz; //1,0
     Image tz; //2,0               
     //Middle Row
     Image zo; //0,1
     Image oo; //1,1
     Image to; //2,1
     //Last Row
     Image zt; //0,2
     Image ot; //1,2     
     Image tt; //2,2
     //Blank Square
     Image c;
     public void init() {
          keyUp=new boolean[4];
          for (int x=0;x<4;x++){
                    keyUp[x]=true;
          //Declare 2d array aImages have 3 by 3 perimeter
          aImages=new Image[3][3];
          //Top Row
          aImages[0][0]=getImage(getCodeBase(),"spiralTOPLEFT(0,0).gif");
          aImages[1][0]=getImage(getCodeBase(),"spiralTOPMIDDLE(1,0).gif");
          aImages[2][0]=getImage(getCodeBase(),"spiralTOPRIGHT(2,0).gif");
          //Middle Row
          aImages[0][1]=getImage(getCodeBase(),"spiralMIDDLELEFT(0,1).gif");
          aImages[1][1]=getImage(getCodeBase(),"spiralMIDDLEMIDDLE(1,1).gif");
          aImages[2][1]=getImage(getCodeBase(),"spiralMIDDLERIGHT(2,1).gif");
          //Bottom Row
          aImages[0][2]=getImage(getCodeBase(),"spiralBOTTOMLEFT(0,2).gif");
          aImages[1][2]=getImage(getCodeBase(),"spiralBOTTOMMIDDLE(1,2).gif");
          aImages[2][2]=getImage(getCodeBase(),"spiralBOTTOMRIGHT(2,2).gif");
     public void paint(Graphics g) {
          //TOP
          g.drawImage(aImages[0][0],20,98,128,128,this);
          g.drawImage(aImages[1][0],148,98,128,128,this);
          g.drawImage(aImages[2][0],276,98,128,128,this);
          //MIDDLE
          g.drawImage(aImages[0][1],20,226,128,128,this);
          g.drawImage(aImages[1][1],148,226,128,128,this);
          g.drawImage(aImages[2][1],276,226,128,128,this);
          //BOTTOM
          g.drawImage(aImages[0][2],20,352,128,128,this);
          g.drawImage(aImages[1][2],148,352,128,128,this);
          g.drawImage(aImages[2][2],276,352,128,128,this);
     public void update(Graphics g) {
          paint(g);
     public void actionPerformed(ActionEvent e) {
     public void keyPressed(KeyEvent event) {
          Kp=event.getKeyCode();
          if (Kp==37);{          //left               
               keyUp[0]=false;
          else if (Kp==39);{  //right
               keyUp[1]=false;
          else if (Kp==38);{  //up
               keyUp[2]=false;
          else if (kp==40);{  //down
               keyUp[3]=false;
          moveImage();
          repaint();
     public void KeyReleased(KeyEvent event) {
          Kp=event.getKeyCode();
          if (Kp==37);{
               keyUp[0]=true;
          else if (Kp==39);{
               keyUp[1]=true;
          else if (Kp==38);{
               keyUp[2]=true;
          else if (Kp==40); {
               keyUp[3]=true;
     public void moveImage() {
}

Hello, and welcome to the forum!
Suggestions:
1) Ask an actual question: the more specific your question, usually the more helpful the answer. This site can help you formulate questions here (I know because it's helped me): [smart questions|http://catb.org/~esr/faqs/smart-questions.html]
2) when posting code here, please use code tags so that your code will retain its formatting and thus will be readable -- after all, your goal is to get as many people to read your post and understand your code as possible, right?
To do this, highlight your pasted code (please be sure that it is already formatted when you paste it into the forum; the code tags don't magically format unformatted code) and then press the code button, and your code will have tags.
Another way to do this is to manually place the tags into your code by placing the tag [cod&#101;] above your pasted code and the tag [cod&#101;] below your pasted code like so:
[cod&#101;]
  // your code goes here
  // notice how the top and bottom tags are different
[/cod&#101;]for example, which is easier to read, your post or this?
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class movingThingGame extends Applet implements ActionListener KeyListener {
     boolean[] keyUp;
     char Kp;
     //Store correct image co-ordinates
     Image[][] aImages;
     //Store mixed image co-ordinates
     Image[][] bImages;
     //Store location of blanked out image
     Boolean[][] cTile;
     //Store x,y,width,height
     Rectangle[][] dInfo;
     //Top Row
     Image zz; //0,0
     Image oz; //1,0
     Image tz; //2,0               
     //Middle Row
     Image zo; //0,1
     Image oo; //1,1
     Image to; //2,1
     //Last Row
     Image zt; //0,2
     Image ot; //1,2     
     Image tt; //2,2
     //Blank Square
     Image c;
     public void init() {
          keyUp=new boolean[4];
          for (int x=0;x<4;x++){
                    keyUp[x]=true;
          //Declare 2d array aImages have 3 by 3 perimeter
          aImages=new Image[3][3];
          //Top Row
          aImages[0][0]=getImage(getCodeBase(),"spiralTOPLEFT(0,0).gif");
          aImages[1][0]=getImage(getCodeBase(),"spiralTOPMIDDLE(1,0).gif");
          aImages[2][0]=getImage(getCodeBase(),"spiralTOPRIGHT(2,0).gif");
          //Middle Row
          aImages[0][1]=getImage(getCodeBase(),"spiralMIDDLELEFT(0,1).gif");
          aImages[1][1]=getImage(getCodeBase(),"spiralMIDDLEMIDDLE(1,1).gif");
          aImages[2][1]=getImage(getCodeBase(),"spiralMIDDLERIGHT(2,1).gif");
          //Bottom Row
          aImages[0][2]=getImage(getCodeBase(),"spiralBOTTOMLEFT(0,2).gif");
          aImages[1][2]=getImage(getCodeBase(),"spiralBOTTOMMIDDLE(1,2).gif");
          aImages[2][2]=getImage(getCodeBase(),"spiralBOTTOMRIGHT(2,2).gif");
     public void paint(Graphics g) {
          //TOP
          g.drawImage(aImages[0][0],20,98,128,128,this);
          g.drawImage(aImages[1][0],148,98,128,128,this);
          g.drawImage(aImages[2][0],276,98,128,128,this);
          //MIDDLE
          g.drawImage(aImages[0][1],20,226,128,128,this);
          g.drawImage(aImages[1][1],148,226,128,128,this);
          g.drawImage(aImages[2][1],276,226,128,128,this);
          //BOTTOM
          g.drawImage(aImages[0][2],20,352,128,128,this);
          g.drawImage(aImages[1][2],148,352,128,128,this);
          g.drawImage(aImages[2][2],276,352,128,128,this);
     public void update(Graphics g) {
          paint(g);
     public void actionPerformed(ActionEvent e) {
     public void keyPressed(KeyEvent event) {
          Kp=event.getKeyCode();
          if (Kp==37);{          //left               
               keyUp[0]=false;
          else if (Kp==39);{  //right
               keyUp[1]=false;
          else if (Kp==38);{  //up
               keyUp[2]=false;
          else if (kp==40);{  //down
               keyUp[3]=false;
          moveImage();
          repaint();
     public void KeyReleased(KeyEvent event) {
          Kp=event.getKeyCode();
          if (Kp==37);{
               keyUp[0]=true;
          else if (Kp==39);{
               keyUp[1]=true;
          else if (Kp==38);{
               keyUp[2]=true;
          else if (Kp==40); {
               keyUp[3]=true;
     public void moveImage() {
}Much luck!

Similar Messages

  • How to make a round Slider with an image ?

    hello everybody,
    I'm back and i have a new question : how to make a round Slider (like a volume knob) with an image ?
    I see this very interisting tutorial : http://fxexperience.com/2012/01/fun-javafx-2-0-audio-player/ but it use a private class from com.sun.javafx.scene.control.skin.SkinBase...
    thank you for your answer.
    Gaëtan.

    I'm guessing you could subclass Slider to create a class SliderKnob.
    At some stage in the process, not sure where (perhaps after calling super in the constructor), you could look up the slider region's child thumbnail and track and call setVisible(false) and setManaged(false) on them, create an ImageView for your knob, add the knob ImageView to the slider's region and bind the ImageView's rotateProperty to the slider's valueProperty(). Not sure that that is any better than using the SkinBase stuff, but at least it is an alternative idea.
    Everything to create your own controls has not been added to the public API, so if you want to make your own controls in the same way the JavaFX does them (i.e. with Skin's and Behaviours and stuff like that) you have to make use of com.sun classes unless you can subclass and modify the workings of existing controls similar to what is proposed in the preceding paragraph.

  • How to make "Levels" in simple java game

    I just wanted to know if anybody knew how to make "Levels" in a java game. In my case, it is to change two polygons that are used in the background. I think you have to use an array of some kind, but i dont really know.
    Here is my source, the polygons are by the massive ///////// areas.
    I cut out the majority of the program, because it was too long.
    public class collision extends Applet implements MouseListener,MouseMotionListener
        private  Image rickImage,mazeImage;
       Image Buffer;
       Graphics gBuffer;
       int x, y;
       int[] LeftWallX = {0,204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,0};
       int[] LeftWallY = {500,499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1};
       //int[] PlayAreaX = {204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
      // int[] PlayAreaY = {499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
       int[] RightWallX = {500,500,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
       int[] RightWallY = {500,0,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
       boolean mouseInside, collide;
       boolean rolled = false;
       boolean msg = true;
       int sX=204,sY=490,sW=12,sH=9;
       //Declare the rectangles
       Rectangle  movingRect,finshBloc,startBloc,oopsBloc;
       //Declare the polygons
       Polygon leftWall,playerArea,rightWall;
            ///Initiate
            public void init()
                 rickImage = getImage(getDocumentBase(), "rick.jpg");
                 mazeImage = getImage(getDocumentBase(), "maze1.jpg");
                 collide=false;
                 Buffer=createImage(getSize().width,getSize().height);
                 gBuffer=Buffer.getGraphics();
                 rightWall=new Polygon(RightWallX,RightWallY,18);
                 playerArea= new Polygon(PlayAreaX,PlayAreaY,31);
                 leftWall= new Polygon(LeftWallX,LeftWallY,17);
            public void paint(Graphics g)
                 drawStuff();
                 g.drawImage (Buffer,0,0, this);
    */

    I'm not exactly sure in your case what you are trying to accomplish. If all you want to do is make new polygons for your levels then you will simply need a Vector of type level (or polygon). Store multiple levels/polygons in that vector. This can be done many ways, probably the most efficient way would be to create a class Level of sorts and create each level object from there. This way you have all your levels stored into that vector.
    I have made programs where the levels/mazes are randomly generated based on certain parameters (this way you would not need to define any specific level). This can be done inside the Level class and added to the vector so that when a level is randomly generated there are literally infinite possibilities. I would suggest posting all your code or at least a breakdown UML diagram of what is going on in your entire program.

  • How to make a wall for a game

    hello developers
    I’m sharing a long time to find out how to make a wall for my game but now where is it.
    Can someone help me?
    its a wall for an iphone/ipod game.
    It must be a wall that a sprite will stop walking it’s not a killer object but a stop object.
    oh and are there differants in programing in ipad/iphone?
    Thanks for help
    Grtz Jimmy

    I don't know what's you point on the wall and the player but you should do something as that:
    -(IBAction)goLeft
         if (player.x > wall.xo && player.x < wall.xI)
                  // you are in the wall go right
              if(player.y > wall.yo && player.y < wall.yI)
                 // you are in the wall go right
                 player.x ++;
              else ; // you are up or down of wall
    -(IBAction)goRight
        if (player.x > wall.xo && player.x < wall.xI)
              if(player.y > wall.yo && player.y < wall.yI)
                 // you are in the wall go left
                 player.x --;
               else ; // you are up or down of wall

  • How to make a cycle Slider

    Dear all friends,
    I'd like to make a circle slide ( Slider that on the shape of circle instead of vertical and horizontal Slider) like this one:
    http://www.spreadshirt.net/en/GB/Create-t-shirt/Create-your-own-59/
    Is there a ready Component on the web.
    If no, how can I make one.
    Thank you so much.

    SwapnilVJ ,
    please email me the attachment as I can't download it.
    Here is my email: [email protected]
    Thank you so much for helping me.

  • How to make  the last slide stay on the screen ?

    Hi,I need to make the last slide of my animation to remain on the screen when the animation ends and also when I export in a quick time movie .
    Does anyone can help me?

    A possible workaround would be to have something appear (like a shape) as a build outside the slide's viewing boundary (if you extend the size of the window, you'll see you have some workspace outside the slide) autmatically after the animation is finished, and set a delay time or build duration based on how long you need the slide to remain on the screen.  How this works will depend on your setup for quicktime export.

  • How to make a left slider?

    The link below contains a slider on the left with title called "Menu" which can be clicked to make it go away and then back on.
    http://apex.oracle.com/pls/otn/f?p=65555:54:289368566520602::NO:
    How do I make it?

    That one is done with ExtJS.
    You can also do someting similar using jQuery Layout Plugin (see http://layout.jquery-dev.net/). An APEX demo is available at http://apex.oracle.com/pls/apex/f?p=41715:60. All panels are resize-able and you can click on a panel separator to show/hide a panel.

  • How to make a really basic pong game for a beginner

    Hello.  I've read through a couple of threads on here dealing with making a game of pong in LabView, but in them the users had questions with far more complex aspects of the program than I want to deal with.  I am a beginner programmer in LabView with limited experience in Java and Visual Basic programming.  I was tasked with creating a game over winter break, and now that I finally have some time (this weekend that is), I decided that I'd make a really simple game of pong.  However, I have seriously overestimated the difficulty of this for a beginner who has very limited knowledge of Lab View.
    I ask you to please have some patience with me.
    I know what I want to do, and just need help inplementing it.
    Here is the idea for my design to keep it as simple as possible:
    -Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
    -Set up some simple function that can output the dimensions of this field to use with collision tracking.
    -Create a ball that can be tracked by the program.
    -From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
    -Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
    Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year.  I want to take things slow.  So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
    If I can at least get that far for now, then I can move on (with help I hope!) of inserting an interactive interface for the "paddle."
    I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
    I thank you for any and all help anyone may be able to provide.

    EchoWolf wrote:
    -Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
     Wel, there is the picture indicator in the picture palette. In newer versions it's called "2D picture". The palettes have a search function. Using the palette search function is a basic LabVIEW skill that you should know. If you've seen the example for the other discussion, it uses a 2D boolean array indicator. The boolean array is only recommended for a monochrome very low resolution display.
    EchoWolf wrote: -Set up some simple function that can output the dimensions of this field to use with collision tracking.
    -Create a ball that can be tracked by the program.
    That seems backwards. Properly programmed, the code always knows the dimension and the ball position. The program generates, (not tracks!) the ball movement. Of course you need to do some range checking on the ball position to see when it collides with the walls.
    EchoWolf wrote:
    -From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
    Of course you could make it more realistic by keeping track of three ball parameters: x, y, spin.
    EchoWolf wrote:
    -Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
    Pong is typically played with the up-down arrow keys.
    EchoWolf wrote:
    Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year.
    LabVIEW knowledge is not measured in time units. What did you do during that month? Did you attend some lectures, study tutorials, wrote some programs?
    EchoWolf wrote:
    So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
    I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
    Start with the posted example and delete all the controls and indicators that you don't want, then surgically remove all code with broken wires.
    Alternatively, start from scratch: Create your playing field. Easiest would be a 2D classic boolean array that is all false. Use initialize array to make it once. Now use a loop to show the ball as a function of time.
    Start with a random ball position. to display it, turn one of the array elements true before wiring to the array indicator using replace array subset.
    Keep a shift register with xy positions and xy velocities and update the positions as a function of the velocities with each iteration of the loop. Do range checking and reverse the velocieis when a edge is encountered.
    What LabVIEW version do you have?
    LabVIEW Champion . Do more with less code and in less time .

  • Not sure how to make a navigational slider?

    Here is the code I started but I want to make a slider naviagation once the page is click then the page marker will move to what page I am on?
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    big_Square_Baling_mc = true;
    big_Square_Bale_Wrapping_mc = true;
    chopping_mc = true;
    tillage_mc = true;
    raking_mc = true;
    big_Square_Baling_mc.addEventListener(MouseEvent.CLICK, Big_Square_Baling);
    big_Square_Bale_Wrapping_mc.addEventListener(MouseEvent.CLICK, Big_Square_Bale_Wrapping);
    chopping_mc.addEventListener(MouseEvent.CLICK, Chopping);
    tillage_mc.addEventListener(MouseEvent.CLICK, Tillage);
    raking_mc.addEventListener(MouseEvent.CLICK, Raking);
    function Big_Square_Baling(e:MouseEvent):void

    your code doesn't reference marker_mc.  and actually, you're cross-posting.  please don't do that.
    continue on your other thread.  you're further along there.

  • How to make vintage prints slide show one photo at a time?

    Does anyone know to program the vintage prints slide show to display only one photo at a time?

    The slideshow templates are fixed and can't be changed.
    Alternatives to iPhoto's slideshow include:
    iMovie, on every Mac sold.
    Others, in order of price: PhotoPresenter  $29
    PhotoToMovie  $49.95
    PulpMotion  $129
    FotoMagico $29 (Home version) ($149 Pro version, which includes PhotoPresenter)
    Final Cut Express  $199
    It's difficult to compare these apps. They have differences in capability - some are driven off templates. some aren't. Some have a wider variety of transitions. Others will have excellent audio controls. It's worth checking them out to see what meets your needs. However, there is no doubt that Final Cut Express is the most capable app of them all. You get what you pay for.
    Regards
    TD

  • How to make a question slide impossible to pass if unaswered

    Hi
    I am using captivate 7 trail, and soon will buy the full version if this feature is possible inside captivate.
    I am building a quiz, and I want the user to first, answer, see if he was right, and then go to the next question. I don't want the user to have the possibility to leave any question unanswered.
    In evere question slide there is a "next" button, and a "submit" button. The user can go back or forward and skip questions. Is there a way to keep the user in this question slide untill answered, or hide the "back" and "next" buttons" untill the questions is answered.
    This is really important for the way I'm using Captivae and it's a big deal breaker for us.
    Any help will be appreciated.
    TNX

    Michael, it was not mentioned, but that Next button is necessary if Preview will be included. That Next button is a Skip button during the Quiz, but needed during Review. You can also play with the stack order and hide the Next button under the Clear button.
    http://blog.lilybiri.com/question-question-slides-in-captivate

  • How to make a text "slide"

    I am creating a DVD that has several short movies on it. In addition to the movies, i would like to put a slide that has a bunch of informational text, set against a background. I tried doing it by creating the text slide in Powerpoint and saving as a movie. iDVD said that was an unsupported format even though it is a .mov file. So I opened the slide movie in Quicktime and exported it as a Quicktime movie. (Sounds redundant, doesn't it?) Then I was able to add it as a movie in iDVD.
    BUT, the only problem is when you open it (the movie) it shows up nicely, but has a lot of flicker when I view it on a TV.
    I tried to reduce the flicker by importing it into Final Cut Pro, but the file was not supported. So i imported into iMovie, then exported, then imported into FCP. I added deinterlace and flicker filters and exported it. Then when I added it to the iDVD, the text looked completely choppy and ugly!!!
    Any suggestions?

    J Keller wrote:
    Create a 720x480 (for NTSC) image; and save it as a jpeg.
    Create a 640x480 image. iDVD will do the conversion from computer pixel to NTSC "pixel" for you. If you start with 720x480, the image will end up squished or maybe it is stretched, but either way, iDVD expects 640x480 as "native" input and will do the conversion for TV sets behind the scenes.
    Patrick

  • How to make an image slide/swipe effect like in #selfie

    Please see http://forums.adobe.com/thread/1444012 - a question (it was mentioned there that AE will do better for what I want to do so I am posting the link here)
    What I want to do is to replicate the image slide/zoom/swipe that you can see in the video.
    Can you please help me get started on the right path?  I am new in AE and need a bit of a start - i.e. if you were to do it, what technique would you approach it with? 
    I can probably manage to do one or two manually, but my issue is that there are so many (similar) effects and I don't want this video to become a daunting chore, so looking for a way to do this very easily somehow. 
    And this is why I am posting - to hopefully find the technique to do this effect right and a do it lot without realizing it is too difficult and giving up ...!

    Thanks
    but I'm sorry .. is there a good tutorial I can read on this?  I am not verse on basics of AE.  I have been working mostly with Premiere.
    I will appreciate some direction even if it's basics.                     

  • How to make a first-person style game with arrow key movement?

    Hey guys, I've made some simple click-to-move 1st person games with AS3, but I just wanted to know if there was a way to move around in 1st person with arrow keys, I was thinking you could get the background to move with the arrow keys, but that would be a little confusing.
    If you guys have any suggestions for me, or if it's possible, please reply! Thanks

    Here is a basic switch usage to move something with the keyboard:
    stage.addEventListener(KeyboardEvent.KEY_DOWN, move_mc);
    function move_mc(event:KeyboardEvent):void {
        switch(event.keyCode)
           case  Keyboard.LEFT : mc.x -= 5
           break;
           case  Keyboard.RIGHT : mc.x += 5
           break;
           case Keyboard.UP : mc.y -= 5
           break;
           case Keyboard.DOWN : mc.y += 5
           break;

  • How to make the server slide form validation using JSP?

    anyone knows how to do server-side form validation??
    Thanks in advanced

    try this way
         //create a validation java class in that class u create separate methods for validating
         for example if u want to validate that a particular text box should not be empty
         then u can try this way
         say like this
         class ServerValidation()
         boolean message=false;
         public static boolean isTextBoxEmpty(String value)
         if(value.length<1)
         System.out.println("Text box is empty");
         message=false
         else
         message=true
         return message
    now say u r having a html page in which there is a text box on submiting u call say validate.jsp
    in this jsp u write this way
    <%
    String message=request.getParameter("name of ur text box");
    boolean b=ServerValidation.isTextBoxEmpty(message)
    if(b)
    //valid is true do ur other activity
    else
    String messageToUser="Please Enter Some value"
    u can now display this message on jsp and create a back button
    %>
    hope its clear

Maybe you are looking for

  • How to import RAW and JPEG, but see only one image?

    This is driving me crazy. I shoot sometimes RAW and sometimes JPEG on the same memory card. So some pictures have only a JPEG file, others (the ones I shot in RAW) have a RAW+JPEG pair (or at least, Aperture sees it that way when displaying the conte

  • Sync is not working with code from my Android

    I had to reinstall ubuntu 13.10 on my desktop and am trying to sync it back with my phone, but when i enter the 4x3 code it's asking me to create or sign in and enter my recovery key, except I can't get my recovery key from my phone.

  • How to insert Javascript into LinkToURL component

    Hi all! I want to start several applications inside the intranet page. To do that in HTML I can access applications by a Javascript code, instantiating Windows Script Shell ActiveX. How to do that in LinkToURL component? Is there any other ways to do

  • CFCACHE IN CF9  - Cant find cached pages!

    I have used CFCACHE in prior versions of CF and the cached page would be kept in the directory I specified. Now when I use the tag in CF9 the page appears to be cached but I can find any cached pages in the directory I specified???? Here is my code:

  • Uninstall - Acrobat and Re-install

    How do I uninstall a CCloud app? - had issue with Acrobat xi pro and need to reinstall but app manager still thinks its installed ---- the original install kept getting stopped with an unresponsive and blank register this product window and the acrob