addMouseListener(this); addMouseMotionListener(this);
MouseInputAdapter mouseInputAdapter = new MouseInputAdapter() { public void mousePressed(MouseEvent e) { Tile clickedTile = getTileAtPoint(e.getX(), e.getY()); if (clickedTile != null) { fireTileSelectionEvent(clickedTile); } }  public void mouseDragged(MouseEvent e) { mousePressed(e); } }; addMouseListener(mouseInputAdapter); addMouseMotionListener(mouseInputAdapter);
    public TilePalettePanel() {        tileSelectionListeners = new EventListenerList();        addMouseListener(this);        addMouseMotionListener(this);    }