I am working to make a kind of paint. I got stuck to something that i do not understand. Look here the fragment of code which is making problem:
So, if the string fp.forma is set to be "oval" (to draw an oval), at the printlns of this part of code, if get :
So, the strange thing that fp.forma = oval, and the if should run if fp.forma == "pencil"!! As in the println System.out.println((fp.forma == "pencil")); that satement is false !!! Why does this if start if the statement is false ? I tried to replace == with equals. and i get the same thing !! Why ? This if is inside the public void mousePressed(MouseEvent e){}, and because this if runs even if i try to draw an oval, it makes that my program not to work properly !!forma: oval
i entered here
false