This might seem strange, but that's kind of the problem :P I'm new to this so please bear with me.
I'm programming in school using Netbeans and we've just started with graphical programming (i.e JPanel, JClass, JFrame). This is my first assignment and the purpose of this program is that when you press the mouse you will fill 4 circles with diffrent colors. I've managed to draw 4 circles with diffrent colors but I want my cursor to change color simultaneously. Here's my code so far (i know that some of it är unnecassary);

As i said, this is really basic programming but my teacher is not the sharpest tool in shed so i couldn't get help from him :/
Hope someone can help me :) Sorry if it's difficult to read my variables since they are in swedish.

January 17th, 2014, 06:12 AM

PhHein

Re: How do I change the color of my cursor?

Hi, google for "java swing custom mouse cursor", there are quite a few tutorials and questions in forums.

It's "wrong" only in the sense that it's inefficient and unnecessarily complex. Also, the variable 'antal' is already initialized, so the last statement in the constructor that calls a method to set the variable 'antal' to the value it already contains is kind of silly plus ineffcient and unnecessarily complex.

More typical or standard declarations of instance variables and their initialization in the constructor would be: