import java.awt.*; import java.awt.event.*; public class ComponentComMouseMotionEvents { Component c; MouseMotionListener ml; public ComponentComMouseMotionEvents(Component s) { c = s; ml = new MouseMotionHandler(); c.addMouseMotionListener(ml); } public static void main(String[] args) { UmaJanela j; if (args.length > 0) j = new UmaJanela(args[0]); else j = new UmaJanela(); new ComponentComMouseMotionEvents(j); new JanelaComWindowEvents(j); j.setVisible(true); } }