Package org.esoul.dsm

Source Code of org.esoul.dsm.GuiBuilder

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);
  }
}
TOP

Related Classes of org.esoul.dsm.GuiBuilder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.