what's non trivila here is ,IMO that I would need to get the coordinates out of the following construction:
the compilers allow only the followingCode:frame.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) {e.getX(); e.getY();} });
but then I cannot reference to them later as they are being errored out by the compiler as not initialized. If I try to assign values in the declaration, the compiler doesn't allow that either...Code:final int a; final int b; frame.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) {a=e.getX(); b=e.getY();} });




Reply With Quote