ballanim.java
来自「用Java实现的跳动的小球」· Java 代码 · 共 41 行
JAVA
41 行
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package ballanim;import java.awt.BorderLayout;import java.awt.Color;import java.awt.Container;import javax.swing.JFrame;/** * * @author Administrator */public class BallAnim extends JFrame{ Container con; Sport ss; public BallAnim(){ super("滚动的小球"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ss = new Sport(); con = this.getContentPane(); con.setLayout(new BorderLayout()); con.setBackground(Color.WHITE); con.add(ss,BorderLayout.CENTER); this.setSize(300, 300); this.setLocationRelativeTo(null); this.setVisible(true); } /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here BallAnim app = new BallAnim(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?