mouse-listeners

A class which implements mouseLIstener and mouseMotionListener in java...

Hi all. I have a question about a class which implements both mouseListener and mouseMotionListener in java. I've recently been splitting up my mouse listeners into different modes in this game I'm making in java, and came across a funny issue when dealing with the Build Item listener. For the game panel, I used two methods to reset t...

How to use mouse drag to move triangle

I draw a triangle using mouse drag. After drawing many different triangles, I wanted to move some of the triangles into different location using mouse drag, however I don't know how to drag the triangle to different location. Help please :=( ...

Getting the colour of where you have clicked on a JPanel?

I only want a method to activate if the pixel that is clicked is white. How would I implement this? Trying to look for a method that returns the colour at a coord, but I can't find one. ...

Losing Focus From A JTextField

After I use my textfield I can't get a jpanel that click on back into focus for my keylistener. It works for the mouselistener but all other keystrokes keep being detected by the textfield not the jpanel. The panel has been setFocusable(true) and works fine until i give the textfield the keyboard focus. It's like the textfield won't rel...