Minimal program architecture for dot-dot series

Source: Internet
Author: User
Tags gety

import java.awt.*; import java.util.*;    import java.awt.event.*;    import javax.swing.jpanel;public class main extends jpanel { static point p = null; public static frame frame = new  Frame ();p ublic static void main (String[] args)  {main f = new main (); Frame.settitle ("Dot-dot"); Frame.add (f);  frame.setsize (500, 500); Frame.addwindowlistener (new  Windowadapter ()  {public void windowclosing (windowevent e)  {system.exit (0);}); Frame.addmouselistener (New mouseadapter ()  { public void mouseclicked (MouseEvent  e)  { p = new point (E.getx (),  e.gety ());   frame.repaint ();}}); Frame.setvisible (TRUE);}   public void paint (graphics g)  {  g.drawstring (P.getX ()  +  "   "&NBSp;+ p.gety (), (int) p.gety (), (int) p.gety ());}  }

Mainly consists of 3 parts and a series of games need to constantly brush the next piece of code with Timmer

Minimal program architecture for dot-dot series

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.