Quote (tigeranden @ Sep 8 2012 11:48am)
thank you all.
I still have a problem though.
What am i doing wrong here:
private void jSlider1MouseClicked(java.awt.event.MouseEvent evt) {
if(SwingUtilities.isLeftMouseButton(evt)==true);
System.out.print("left");
if(SwingUtilities.isRightMouseButton(evt)==true);
System.out.print(" rigth ");
if(SwingUtilities.isMiddleMouseButton(evt)==true);
System.out.print("Middle");
}
whether I left, right or midlleclick I always get the result "left right middle" :/
thats because all your if statements end with semi colons.
if you're using eclipse, right click the project, go to properties, then click the plus sign next to compiler settings, errors/warnings. one of them is something like "empty statement" and set it to "error". then these three will produce compile-time errors and tell you that the statement does nothing.
This post was edited by carteblanche on Sep 8 2012 10:39am