addMouseMotionListener(this);\r
addMouseListener(this);\r
\r
+ addMouseWheelListener(new MouseWheelListener()\r
+ {\r
+ public void mouseWheelMoved(MouseWheelEvent e)\r
+ {\r
+ if (e.getWheelRotation() > 0)\r
+ {\r
+ scale = (float) (scale * 1.1);\r
+ redrawneeded = true;\r
+ repaint();\r
+ }\r
+\r
+ else\r
+ {\r
+ scale = (float) (scale * 0.9);\r
+ redrawneeded = true;\r
+ repaint();\r
+ }\r
+ }\r
+ });\r
+\r
+\r
findCentre();\r
findWidth();\r
\r
return prefsize;\r
}\r
\r
- public void keyPressed(KeyEvent evt) {\r
- int key = evt.getKeyChar();\r
+ public void keyPressed(KeyEvent evt)\r
+ {\r
if (evt.getKeyCode() == KeyEvent.VK_UP)\r
{\r
scale = (float) (scale * 1.1);\r