摘要:
总结:使用匿名类,但是用实现接口的方式呢???package com.aa;import java.awt.Color;import java.awt.Graphics;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;import java.util.Random;//这是要实现画圈import javax.swing.*;class Yuan extends JFr 阅读全文
摘要:
package com.aa;import java.awt.Color;import java.awt.Graphics;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;//内部类,和接口的实现import javax.swing.*;//现在实现用鼠标点击一下,画一个圆class Circle extends JFrame { int x, y; public Circle() { ini(); this.setVisible(true); this.setSize(400, 400); thi... 阅读全文