Page 1 of 2 12 LastLast
Results 1 to 20 of 36
Like Tree3Likes

Thread: how to drage my card images draw on applet.

  1. #1
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default how to drage my card images draw on applet.

    Hi,
    I want to drag and drop my card images on applet, I have successfully draw images on applet and now I want to drag it, please help me, what can I do for this.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    Try using a mouse listener and a mouse motion listener.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: how to drage my card images draw on applet.

    Quote Originally Posted by Norm View Post
    Try using a mouse listener and a mouse motion listener.
    I have implement both mouse listener and a mouse motion listener in my program and extends with JApplet,

    I have perform some code for drag images but not dragging images....
    Code executed in mouseDragged and mousePressed method, but not working....

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    but not working..
    Hard to say what the problem is. I can not see the code and there are so many ways for programs to not work.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: how to drage my card images draw on applet.

    what can I do?, please check my code at once.........

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    What code?
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: how to drage my card images draw on applet.

    My code is given bellow:

    package com.progresso;

    import java.applet.AudioClip;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.MediaTracker;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Random;


    import javax.swing.JApplet;

    public class ShowCard extends JApplet implements MouseListener,Runnable,
    MouseMotionListener {


    private static final long serialVersionUID = 1L;
    Image image,image1,img,img1,Casino_table_img;
    MediaTracker tr;
    int x=105;
    int y=210;
    private int _initX = 105;
    private int _initY = 210;
    private ShowCard _currentCard = null;
    private int _dragFromX;
    private int _dragFromY;
    private static final int IMAGE_WIDTH = 73;
    private static final int IMAGE_HEIGHT = 97;
    static ShowCard[] _deck = new ShowCard[104];
    int[] cards = new int[104];
    public Boolean[] nums = new Boolean[52];
    AudioClip audioClip;
    String suits = "shdcshdc";
    String faces = "a23456789tjqk";
    int cardPosition = 0;
    Image card;
    int n=104;
    private int[] x1 = {200,220,240,260,280,300,320,340,360,380};
    private int[] y1 = {320,320,320,320,320,320,320,320,320,320};
    private int[] x2 = {200,220,240,260,280,300,320,340,360,380};
    private int[] y2 = {110,110,110,110,110,110,110,110,110,110};
    private int[] x83= {100,101,102,103,104,105,106,107,108,109,110,111,1 12,113,114,115,116,117,118,119,120,121,122,123,124 ,125,126,127,128,129,130,131,132,133,134,135,136,1 37,138,139,140,141,142,143,144,145,146,147,148,149 ,150,151,152,153,154,155,156,157,158,159,160,161,1 62,163,164,165,166,167,168,169,170,171,172,173,174 ,175,176,177,178,179,180,181,182,183};
    private int[] y83= {210,210,210,210,210,210,210,210,210,210,210,210,2 10,210,210,210,210,210,210,210,210,210,210,210,210 ,210,210,210,210,210,210,210,210,210,210,210,210,2 10,210,210,210,210,210,210,210,210,210,210,210,210 ,210,210,210,210,210,210,210,210,210,210,210,210,2 10,210,210,210,210,210,210,210,210,210,210,210,210 ,210,210,210,210,210,210,210,210,210};
    private int[] x3 = {305};
    private int[] y3 = {210};
    Random rgen = new Random();
    List<Integer> intList = new ArrayList<Integer>();
    List<Integer> intList_ten = new ArrayList<Integer>();
    List<Integer> intList_ten_user = new ArrayList<Integer>();
    List<Integer> intList_ten_83 = new ArrayList<Integer>();
    List<Integer> intList_ten_one = new ArrayList<Integer>();
    int frame = 0;
    volatile Thread thread;

    public ShowCard()
    {

    Demo1(image,x83,y83);
    }
    public ShowCard(Image image, int[] x83, int[] y83) {
    this.image = image;

    this.x83 = x83;
    this.y83 = y83;
    //System.out.println("Card is: "+this.image);

    }
    public void Demo1(Image image, int[] x832, int[] y832) //here x and y is 0-51;
    {
    this.image = image;

    this.x83 = x832;
    this.y83 = y832;

    //--- Add mouse listeners.
    }

    public void init()
    {

    setSize(800, 500);
    setPreferredSize(new Dimension(300, 300));
    audioClip = getAudioClip(getCodeBase(), "audio/TestSnd.wav");
    img1 = getImage(getCodeBase(),"cards/b.gif");
    Casino_table_img = getImage(getCodeBase(),"cards/casino_table2.gif");
    try {

    System.out.println("1");
    for (int suit=0; suit<suits.length(); suit++)
    {
    for (int face=0; face<faces.length(); face++)
    {
    //img = getImage(getCodeBase(),"cards/"+ faces.charAt(face)
    // + suits.charAt(suit) + ".gif");
    card=getImage(getCodeBase(),"cards/"+ faces.charAt(face)
    + suits.charAt(suit) + ".gif");
    _deck[cardPosition++] = new ShowCard(card, x83,y83);
    }

    }
    }catch (Exception ex)
    {
    ex.printStackTrace(System.out);
    // handle exception...
    }
    for (int crd=0; crd<_deck.length; crd++)
    {
    intList.add(crd);
    }

    try
    {
    for(int j =0; j <10; j++)
    {
    //System.out.println(j);
    int randomPosition = rgen.nextInt(intList.size());
    System.out.println("Random no. is: "+randomPosition);
    intList_ten.add(randomPosition);
    intList.remove(randomPosition);

    }
    for(int j =0; j <10; j++)
    {
    int randomPosition = rgen.nextInt(intList.size());
    System.out.println("Random no. is: "+randomPosition);
    intList_ten_user.add(randomPosition);
    intList.remove(randomPosition);

    }
    for (int crd=0; crd<1; crd++)
    {
    int randomPosition = rgen.nextInt(intList.size());
    intList_ten_one.add(randomPosition);
    intList.remove(randomPosition);

    }
    for (int crd=0; crd<intList.size(); crd++)
    {
    int randomPosition = rgen.nextInt(intList.size());
    intList_ten_83.add(randomPosition);

    }

    }


    catch (Exception e) {
    System.err.println("Caught IOException: " + e.getMessage());
    }
    this.addMouseListener(this);
    this.addMouseMotionListener(this);

    }

    public void start()
    {

    System.out.println("Start");
    }
    public void stop()
    {

    }


    public void run() {
    int delay = 2000; // 2 second
    try {
    while (thread == Thread.currentThread()) {
    frame = (frame+1)%_deck.length;
    repaint();
    Thread.sleep(delay);
    }
    } catch (Exception e) {
    }
    }

    public void paint(Graphics g)
    {
    //System.out.println("paint");
    //super.paintComponents(g); // Required
    g.drawImage(Casino_table_img, 20, 20, this);

    try{

    for(int j =0; j <10; j++)//for ten
    {
    intList_ten.get(j);
    ShowCard c = _deck[intList_ten.get(j)];
    g.drawImage(c.image, x1[j],y1[j], this );

    }
    for(int j =0; j <10; j++)
    {
    ShowCard c = _deck[intList_ten_user.get(j)];
    g.drawImage(c.image,x2[j],y2[j], this);
    //g.drawImage(img1,x2[j],y2[j], this);
    }

    for(int j =0; j <1; j++)
    {
    ShowCard c = _deck[intList_ten_one.get(j)];
    g.drawImage(c.image,x3[j],y3[j], this);

    }

    for (int crd=0; crd<intList_ten_83.size(); crd++)
    {

    ShowCard c = _deck[intList_ten_83.get(crd)];
    //g.drawImage(c.image, c.x,c.y, this);
    g.drawImage(c.image,c.x83[crd],c.y83[crd], this);
    //g.drawImage(img1, c.x,c.y, this);
    //System.out.println("ok"+c.x+"ok"+c.y);

    }

    }
    catch (Exception e) {
    System.err.println("Caught IOException: " + e.getMessage());

    }
    System.out.println("ok");
    }//end paintComponent


    public void mousePressed(MouseEvent e) {
    int x = e.getX(); // Save the x cord of the click
    int y = e.getY(); // Save the y cord of the click
    System.out.println(e.getX());
    _currentCard = null;
    for (int crd=intList.size()-1; crd>=0; crd--) {
    ShowCard testCard = _deck[crd];
    if (x >= testCard.x && x <= (testCard.x + IMAGE_WIDTH)
    && y >= testCard.x && y <= (testCard.x + IMAGE_HEIGHT)) {
    _currentCard= null;
    _dragFromX = x - testCard.x; // how far from left
    _dragFromY = y - testCard.y; // how far from top
    _currentCard = testCard; // Remember what we're dragging.
    System.out.println(_currentCard);
    break; // Stop when we find the first match.
    }
    }
    }//end mousePressed


    /** Set x,y to mouse position and repaint. */
    public void mouseDragged(MouseEvent e) {
    if (_currentCard != null) { // Non-null if pressed inside card image.
    _currentCard.x = e.getX() - _dragFromX;
    _currentCard.y = e.getY() - _dragFromY;


    //--- Don't move the image off the screen sides
    _currentCard.x = Math.max(_currentCard.x, 0);
    _currentCard.x = Math.min(_currentCard.x, getWidth()-IMAGE_WIDTH);//407
    //System.out.println(e.getX() - _dragFromX);

    //--- Don't move the image off top or bottom
    _currentCard.y = Math.max(_currentCard.y, 0);
    _currentCard.y = Math.min(_currentCard.y, getHeight()-IMAGE_HEIGHT);//403

    this.repaint();
    }
    }//end mouseDragged

    public void mouseExited(MouseEvent e) {
    _currentCard = null;
    System.out.println("7");
    }//end mouseExited
    //=============================================== Ignore other mouse events.
    public void mouseMoved (MouseEvent e) { } // ignore these events
    public void mouseEntered (MouseEvent e) { } // ignore these events
    public void mouseClicked (MouseEvent e) { } // ignore these events
    public void mouseReleased(MouseEvent e) {
    audioClip.play();
    } // ignore these events


    }
    Last edited by ganesh.gothi@gmail.com; 04-27-2012 at 02:40 PM. Reason: code in tage

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    Please edit your code and add code tags.

    CODE tags not QUOTES
    Last edited by Norm; 04-27-2012 at 02:43 PM.
    DarrylBurke and sunde887 like this.
    If you don't understand my response, don't ignore it, ask a question.

  9. #9
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: how to drage my card images draw on applet.

    Quote Originally Posted by Norm View Post
    Please edit your code and add code tags.

    CODE tags not QUOTES
    Java Code:
    package com.progresso;
    
    import java.applet.AudioClip;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.MediaTracker;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Random;
    
    
    import javax.swing.JApplet;
    
    public class ShowCard extends JApplet implements MouseListener,Runnable, 
    MouseMotionListener {
    
    
    private static final long serialVersionUID = 1L;
    Image image,image1,img,img1,Casino_table_img;
    MediaTracker tr;
    int x=105;
    int y=210;
    private int _initX = 105; 
    private int _initY = 210; 
    private ShowCard _currentCard = null; 
    private int _dragFromX; 
    private int _dragFromY;
    private static final int IMAGE_WIDTH = 73;
    private static final int IMAGE_HEIGHT = 97;
    static ShowCard[] _deck = new ShowCard[104];
    int[] cards = new int[104]; 
    public Boolean[] nums = new Boolean[52];
    AudioClip audioClip;
    String suits = "shdcshdc";
    String faces = "a23456789tjqk";
    int cardPosition = 0;
    Image card;
    int n=104;
    private int[] x1 = {200,220,240,260,280,300,320,340,360,380};
    private int[] y1 = {320,320,320,320,320,320,320,320,320,320};
    private int[] x2 = {200,220,240,260,280,300,320,340,360,380};
    private int[] y2 = {110,110,110,110,110,110,110,110,110,110};
    private int[] x83= {100,101,102,103,104,105,106,107,108,109,110,111,1 12,113,114,115,116,117,118,119,120,121,122,123,124 ,125,126,127,128,129,130,131,132,133,134,135,136,1 37,138,139,140,141,142,143,144,145,146,147,148,149 ,150,151,152,153,154,155,156,157,158,159,160,161,1 62,163,164,165,166,167,168,169,170,171,172,173,174 ,175,176,177,178,179,180,181,182,183};
    private int[] y83= {210,210,210,210,210,210,210,210,210,210,210,210,2 10,210,210,210,210,210,210,210,210,210,210,210,210 ,210,210,210,210,210,210,210,210,210,210,210,210,2 10,210,210,210,210,210,210,210,210,210,210,210,210 ,210,210,210,210,210,210,210,210,210,210,210,210,2 10,210,210,210,210,210,210,210,210,210,210,210,210 ,210,210,210,210,210,210,210,210,210};
    private int[] x3 = {305};
    private int[] y3 = {210};
    Random rgen = new Random();
    List<Integer> intList = new ArrayList<Integer>();
    List<Integer> intList_ten = new ArrayList<Integer>();
    List<Integer> intList_ten_user = new ArrayList<Integer>();
    List<Integer> intList_ten_83 = new ArrayList<Integer>();
    List<Integer> intList_ten_one = new ArrayList<Integer>();
    int frame = 0;
    volatile Thread thread;
    
    public ShowCard()
    {
    
    Demo1(image,x83,y83);
    }
    public ShowCard(Image image, int[] x83, int[] y83) {
    this.image = image;
    
    this.x83 = x83;
    this.y83 = y83;
    //System.out.println("Card is: "+this.image);
    
    }
    public void Demo1(Image image, int[] x832, int[] y832) //here x and y is 0-51;
    {
    this.image = image;
    
    this.x83 = x832;
    this.y83 = y832;
    
    //--- Add mouse listeners.
    }
    
    public void init()
    {
    
    setSize(800, 500);
    setPreferredSize(new Dimension(300, 300));
    audioClip = getAudioClip(getCodeBase(), "audio/TestSnd.wav");
    img1 = getImage(getCodeBase(),"cards/b.gif");
    Casino_table_img = getImage(getCodeBase(),"cards/casino_table2.gif");
    try { 
    
    System.out.println("1");
    for (int suit=0; suit<suits.length(); suit++) 
    {
    for (int face=0; face<faces.length(); face++) 
    { 
    //img = getImage(getCodeBase(),"cards/"+ faces.charAt(face)
    // + suits.charAt(suit) + ".gif");
    card=getImage(getCodeBase(),"cards/"+ faces.charAt(face)
    + suits.charAt(suit) + ".gif");
    _deck[cardPosition++] = new ShowCard(card, x83,y83);
    }
    
    }
    }catch (Exception ex)
    {
    ex.printStackTrace(System.out); 
    // handle exception...
    }
    for (int crd=0; crd<_deck.length; crd++) 
    {
    intList.add(crd);
    }
    
    try
    {
    for(int j =0; j <10; j++)
    {
    //System.out.println(j);
    int randomPosition = rgen.nextInt(intList.size());
    System.out.println("Random no. is: "+randomPosition);
    intList_ten.add(randomPosition);
    intList.remove(randomPosition);
    
    }
    for(int j =0; j <10; j++)
    {
    int randomPosition = rgen.nextInt(intList.size());
    System.out.println("Random no. is: "+randomPosition);
    intList_ten_user.add(randomPosition);
    intList.remove(randomPosition);
    
    }
    for (int crd=0; crd<1; crd++)
    {
    int randomPosition = rgen.nextInt(intList.size());
    intList_ten_one.add(randomPosition);
    intList.remove(randomPosition);
    
    } 
    for (int crd=0; crd<intList.size(); crd++)
    {
    int randomPosition = rgen.nextInt(intList.size());
    intList_ten_83.add(randomPosition);
    
    } 
    
    }
    
    
    catch (Exception e) {
    System.err.println("Caught IOException: " + e.getMessage());
    }
    this.addMouseListener(this); 
    this.addMouseMotionListener(this);
    
    }
    
    public void start()
    {
    
    System.out.println("Start");
    }
    public void stop()
    {
    
    }
    
    
    public void run() {
    int delay = 2000; // 2 second
    try {
    while (thread == Thread.currentThread()) {
    frame = (frame+1)%_deck.length;
    repaint();
    Thread.sleep(delay);
    }
    } catch (Exception e) {
    }
    }
    
    public void paint(Graphics g)
    { 
    //System.out.println("paint");
    //super.paintComponents(g); // Required
    g.drawImage(Casino_table_img, 20, 20, this);
    
    try{
    
    for(int j =0; j <10; j++)//for ten 
    {
    intList_ten.get(j);
    ShowCard c = _deck[intList_ten.get(j)];
    g.drawImage(c.image, x1[j],y1[j], this );
    
    }
    for(int j =0; j <10; j++)
    {
    ShowCard c = _deck[intList_ten_user.get(j)];
    g.drawImage(c.image,x2[j],y2[j], this);
    //g.drawImage(img1,x2[j],y2[j], this);
    }
    
    for(int j =0; j <1; j++)
    {
    ShowCard c = _deck[intList_ten_one.get(j)];
    g.drawImage(c.image,x3[j],y3[j], this);
    
    }
    
    for (int crd=0; crd<intList_ten_83.size(); crd++)
    {
    
    ShowCard c = _deck[intList_ten_83.get(crd)];
    //g.drawImage(c.image, c.x,c.y, this);
    g.drawImage(c.image,c.x83[crd],c.y83[crd], this);
    //g.drawImage(img1, c.x,c.y, this);
    //System.out.println("ok"+c.x+"ok"+c.y);
    
    } 
    
    }
    catch (Exception e) {
    System.err.println("Caught IOException: " + e.getMessage());
    
    }
    System.out.println("ok");
    }//end paintComponent
    
    
    public void mousePressed(MouseEvent e) {
    int x = e.getX(); // Save the x cord of the click
    int y = e.getY(); // Save the y cord of the click
    System.out.println(e.getX());
    _currentCard = null;
    for (int crd=intList.size()-1; crd>=0; crd--) {
    ShowCard testCard = _deck[crd];
    if (x >= testCard.x && x <= (testCard.x + IMAGE_WIDTH)
    && y >= testCard.x && y <= (testCard.x + IMAGE_HEIGHT)) {
    _currentCard= null;
    _dragFromX = x - testCard.x; // how far from left
    _dragFromY = y - testCard.y; // how far from top
    _currentCard = testCard; // Remember what we're dragging.
    System.out.println(_currentCard);
    break; // Stop when we find the first match.
    }
    }
    }//end mousePressed
    
    
    /** Set x,y to mouse position and repaint. */
    public void mouseDragged(MouseEvent e) {
    if (_currentCard != null) { // Non-null if pressed inside card image.
    _currentCard.x = e.getX() - _dragFromX;
    _currentCard.y = e.getY() - _dragFromY;
    
    
    //--- Don't move the image off the screen sides
    _currentCard.x = Math.max(_currentCard.x, 0);
    _currentCard.x = Math.min(_currentCard.x, getWidth()-IMAGE_WIDTH);//407
    //System.out.println(e.getX() - _dragFromX);
    
    //--- Don't move the image off top or bottom
    _currentCard.y = Math.max(_currentCard.y, 0);
    _currentCard.y = Math.min(_currentCard.y, getHeight()-IMAGE_HEIGHT);//403
    
    this.repaint();
    }
    }//end mouseDragged
    
    public void mouseExited(MouseEvent e) {
    _currentCard = null;
    System.out.println("7");
    }//end mouseExited
    //=============================================== Ignore other mouse events.
    public void mouseMoved (MouseEvent e) { } // ignore these events
    public void mouseEntered (MouseEvent e) { } // ignore these events
    public void mouseClicked (MouseEvent e) { } // ignore these events
    public void mouseReleased(MouseEvent e) { 
    audioClip.play();
    } // ignore these events
    
    
    }

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    Have you tried debugging the code to see what it is doing? Add lots of printlns to show where the code is executing and the values of variables every time theor values are changed. the print outs will help you understand what the code is doing.
    I don't have the images an can not test the code.
    If you don't understand my response, don't ignore it, ask a question.

  11. #11
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: how to drage my card images draw on applet.

    Quote Originally Posted by Norm View Post
    Please edit your code and add code tags.

    CODE tags not QUOTES
    Yes , I have tried with put println in my code, but I am not getting what is the problem, that's why I am sharing my problem with you,,,please solve my problem.

    I am using eclipse , you want to images for testing this code?
    Last edited by ganesh.gothi@gmail.com; 04-27-2012 at 04:29 PM. Reason: add more text.

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    I am trying to help you solve your problem.
    Can you post the debug output that shows how the code is executing and the values of the variables as they change.

    Please explain what the code does when it executes and describe what is wrong with what it is doing.


    Can you attach a zip with the images?
    Last edited by Norm; 04-27-2012 at 04:36 PM.
    If you don't understand my response, don't ignore it, ask a question.

  13. #13
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: how to drage my card images draw on applet.

    In the above code I am trying to develop card game for the user to play, In this code I have draw 10 cards up ( g.drawImage(c.image,x2[j],y2[j], this); ) by and 10 cards down by (g.drawImage(c.image, x1[j],y1[j], this );) and 1 cards in the center on the applet, now the remaining 83 cards of 104, will be displayed on the center as I want. now I want to drag this 83 cards one by one as game will be played and also drag 10 cards that is draw bellow side at
    (g.drawImage(c.image, x1[j],y1[j], this );) will be dragged.
    So now I want to drag 83 cards one by one, please help me...........

  14. #14
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    I want to drag this 83 cards one by one
    Please post the debug output that shows what is happening when you execute the code and try to drag a card.
    Does the card move any? Explain what happens when you try to drag a card.

    I can not test without the images.
    If you don't understand my response, don't ignore it, ask a question.

  15. #15
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: how to drage my card images draw on applet.

    I am not attaching zip file, please download from the URL, please download cards20.zip file show in red color, please download this and test it.......

    Java: Example - Card Demo

  16. #16
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    Please attach a zip. I don't go to third party sites.

    Please answer my questions:

    Please post the debug output that shows what is happening when you execute the code and try to drag a card.
    Does the card move any? Explain what happens when you try to drag a card.
    If you don't understand my response, don't ignore it, ask a question.

  17. #17
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: how to drage my card images draw on applet.

    I am using applet tag in html for showing applet on browser. when I am run my above code , it shows all 104 cards and its arrange as 10 up, 10 down, 1 center and remaining 83 also in center as required, now i want to drag first card into 83 cards that is show in top position and drop into other location, this is I am trying to do,,,,,,,,,please help me.......

  18. #18
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    Please post the debug output that shows what is happening when you execute the code and try to drag a card.
    Does the card move any? Explain what happens when you try to drag a card.

    I need the images to test the code.
    If you don't understand my response, don't ignore it, ask a question.

  19. #19
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: how to drage my card images draw on applet.

    Quote Originally Posted by Norm View Post
    Please post the debug output that shows what is happening when you execute the code and try to drag a card.
    Does the card move any? Explain what happens when you try to drag a card.

    I need the images to test the code.
    I am not attaching a zip file can I use insert images tag for for insert images for your test code..?

  20. #20
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,556
    Rep Power
    25

    Default Re: how to drage my card images draw on applet.

    How do I test the code without images? If you have a version of the code that does not require images, please post it.
    Otherwise I can do nothing more.
    If you don't understand my response, don't ignore it, ask a question.

Page 1 of 2 12 LastLast

Similar Threads

  1. how to generate 10 random card Images in applet graphics
    By ganesh.gothi@gmail.com in forum Java Applets
    Replies: 20
    Last Post: 04-19-2012, 08:47 PM
  2. Replies: 11
    Last Post: 11-25-2011, 04:56 AM
  3. Draw Large Images
    By Sreekanth.m in forum Java 2D
    Replies: 1
    Last Post: 09-08-2009, 04:53 PM
  4. How to draw 2 images with quality?
    By Panchitopro in forum Java 2D
    Replies: 1
    Last Post: 03-12-2009, 08:31 AM
  5. How to draw images in SWT
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-02-2008, 08:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •