Java-小程序抽绳

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java-小程序抽绳相关的知识,希望对你有一定的参考价值。

  1.  
  2. <head>
  3. <title>Sono una Applet...</title>
  4. </head>
  5.  
  6. <body>
  7. <applet code="Example01.class" width="300" height="300">Non sono supportata...</applet>
  8. </body>
  9.  
  10. </html>
  11.  
  12.  
  13. import java.awt.Color;
  14. import java.awt.Graphics;
  15. import java.awt.event.MouseEvent;
  16. import java.awt.event.MouseMotionListener;
  17.  
  18. import javax.swing.JApplet;
  19.  
  20. public class Example01 extends JApplet implements MouseMotionListener
  21. {
  22. public void init()
  23. {
  24. this.addMouseMotionListener(this);
  25. }
  26.  
  27. public void start()
  28. {
  29. this.setBackground(Color.YELLOW);
  30. this.repaint(); // Ridisegna lo schermo
  31. }
  32.  
  33. public void paint(Graphics g)
  34. {
  35. super.paint(g);
  36. }
  37.  
  38. public void mouseDragged(MouseEvent e)
  39. {
  40.  
  41. }
  42.  
  43. public void mouseMoved(MouseEvent e)
  44. {
  45. Graphics g = this.getGraphics();
  46.  
  47. g.drawLine(e.getX(), e.getY(), e.getX(), e.getY());
  48. }
  49. }

以上是关于Java-小程序抽绳的主要内容,如果未能解决你的问题,请参考以下文章

微信小程序java能编写吗

java的小程序启动出现请使用前端地址访问

怎样运行自己编好的JAVA小程序?

java小程序的一个bug

Java 小程序不适用于小程序的远程调试

java的一个小程序,帮我看看哪不对?