import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent;import javax.swing.JFrame;public class T { public static void main(String[] args) { JFrame f = new JFrame(); f.addComponentListener(new ComponentAdapter() { public void componentMoved(ComponentEvent e) { System.out.println(e.getComponent().getLocation()); } });
import java.awt.event.ComponentEvent;import javax.swing.JFrame;public class T {
public static void main(String[] args) {
JFrame f = new JFrame();
f.addComponentListener(new ComponentAdapter() {
public void componentMoved(ComponentEvent e) {
System.out.println(e.getComponent().getLocation());
}
});
f.setSize(200, 200);
f.setLocationRelativeTo(null);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}