package org.esoul.dsm;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import javax.swing.JFrame;
public class GuiBuilder implements Runnable {
@Override
public void run() {
JFrame f = new JFrame("DSM");
final GamePlain gamePlain = new GamePlain();
f.getContentPane().add(gamePlain);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(640, 480);
f.addMouseMotionListener(new MouseMotionListener() {
@Override
public void mouseMoved(MouseEvent e) {
gamePlain.setShipLocation(e.getPoint());
}
@Override
public void mouseDragged(MouseEvent e) {
// do nothing
}
});
f.setVisible(true);
}
}