Search:

Type: Posts; User: gargamel7

Search: Search took 0.10 seconds.

  1. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    Ok! :) Thanks for all the help! Very appreciated!
  2. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    So itīs nothing thatīs going to make my program run slower then? (So that I know for bigger projects)
  3. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    Well, not loaded three times each, but the img is returned three times each.
  4. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    I moved the loading of images to the constructor and it worked. The flowers are now drawn. The output is:


    The pointer class now looks like this:


    I guess the images are loaded three times...
  5. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    Everything you wanted me to do was already in there.

    Pointer class:


    fileName=pink.jpg
    fileName=weird.jpg
    fileName=rose.jpg
    is the output, so we just want to fix the issues with calling...
  6. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    Why introduce the new variable fPath when i had the variable fileName that did the same thing?

    Nothing in my getImg() method ever happens during runtime (no printlns are executed etc), so I guess...
  7. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    pink = something; //pink becomes something

    I know what an assignment statement is.

    I removed public String pink; (and rose, weird)
    I did as you said and used this snippet:
    pPink = new...
  8. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    Yes, the filenames on my computer are pink.jpg, rose.jpg and weird.jpg. But, the variable fileName may be just pink, rose or weird, so there is a slight confusion there.

    Your second paragraph: I...
  9. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    The filenames are: pink, weird and rose

    I canīt answer your second question but to again tell you about the idea about how it works, since pink not = something, but becomes a part of the pink.jpg ...
  10. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    I think nobody can blame me for not being interested in solving this issue since Iīve been watching the code over and over the last days. Iīm new to programming so itīs of course possible to not see...
  11. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    I donīt understand your question. I know how to assign a value to a var, but you got the code so I donīt see why you donīt just check it since itīs so short.
  12. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    My idea of structuring this was to create these three pointer objects with the variables speed and fileName. The fileName that then is either pink, weird or rose are used in this method to get the...
  13. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    public Clock(){
    pPink = new Pointer(3600,pink);
    pWeird = new Pointer(60,weird);
    pRose = new Pointer(1,rose);

    }
  14. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    The filenames are: pink.jpg, weird.jpg and rose.jpg.
    Hereīs the code with some changes. When compiled I see the wheel pic and the printlns: fileName=null.jpg, three times on separate lines.
    ...
  15. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    Im using my android now so i cant check the code but i believe i put
    System.out.println("img=" + img + ".jpg"); into the program. But it doesnt matter what string u write since it's not a reference...
  16. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    That the img is not defined to an image and therefore is a null.jpg. Of course there are no images that is named null.jpg (as the code tells, there are wheel, pink, rose and weird).
  17. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    img=null.jpg
    img=null.jpg
    img=null.jpg
  18. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    When i insert that println nothing happens. Nothing happens when i insert a println before calling
    the getImg() method either. The imageIcon snippet is still in the getImg() method since there are...
  19. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    Yes, I understand that you learn me debug tips, simply just didnīt understand what you wrote that i should do. However, the wheel picture is okay and everything, but the flower pics wont be shown....
  20. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    When I move this to the pointer-constructor: ImageIcon ii = new ImageIcon(this.getClass().getResource(img+".jpg"));
    img = ii.getImage();, i get error messages and it wont compile (I changed img to...
  21. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    No there are no error messages. It compiles correct and I see a window with a bike wheel in it.


    I did like they did in here: (scroll down a bit for the Image part).
    Basics

    What do I do wrong...
  22. Replies
    48
    Views
    3,163

    Re: Analogue Clock Problem

    I see the bike wheel (wheel.png) when I execute the code (which I want). When I insert a System.out.println("this is loaded"); in the getImg() method, nothing happens. So the problem is in the...
  23. Replies
    48
    Views
    3,163

    Analogue Clock Problem

    Hello!

    My first post! Woo!

    Iīm making an analogue clock which consists of a bike wheel as "the clock" and three pointers which are images of different flowers!
    Iīm having problem with...
Results 1 to 23 of 23