static void addMouseListener(final JComponent c, final MouseListener l) { if (c != null) swing { c.addMouseListener(l); } }