C
Ce
Hello.
I'm new to Java programming, so forgive me if I'm asking stupid questions.
I wrote my own class "Sprite" because I'm writing a little java game. Now,
I
was trying to made my sprites aware of mouse clicks.
I tried to implement the MouseListener interface in my class and tried to
override mouse access methods. All ok, but when I try to call the
addMouseListener(this)
in the contrsuctor of my Sprite class, I get a compilation error "cannot
find
symbol". By looking in docs and internet I understood that this is
happening becuase
I'm not extending any AWT object here, but just using my own class. Is
there any
way to have addMouseListener available in a "custom class" (so, wrote from
scratch without
extending other java classes)?
Thanks,
Ce
I'm new to Java programming, so forgive me if I'm asking stupid questions.
I wrote my own class "Sprite" because I'm writing a little java game. Now,
I
was trying to made my sprites aware of mouse clicks.
I tried to implement the MouseListener interface in my class and tried to
override mouse access methods. All ok, but when I try to call the
addMouseListener(this)
in the contrsuctor of my Sprite class, I get a compilation error "cannot
find
symbol". By looking in docs and internet I understood that this is
happening becuase
I'm not extending any AWT object here, but just using my own class. Is
there any
way to have addMouseListener available in a "custom class" (so, wrote from
scratch without
extending other java classes)?
Thanks,
Ce