drawpanel.java
来自「采用基础Java语言实现的一个类似于Windows中的画图程序。」· Java 代码 · 共 47 行
JAVA
47 行
/*
* Drawpanel.java
*
* Created on 2007年6月15日, 下午2:45
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package huaban;
import java.awt.BorderLayout;
import javax.swing.JFrame;
public class Drawpanel extends JFrame{
gongju Toolbar;
color panel;
ShapePanel panel1;
menubar menubar1;
public Drawpanel() {
super("画图工具");
this.setLayout(new BorderLayout());
menubar1 = new menubar(this);
panel = new color();
panel1 = new ShapePanel(panel);
panel1.addMouseListener(panel1);
panel1.addMouseMotionListener(panel1);
Toolbar = new gongju(panel1);
this.add(Toolbar,"West");
this.add(panel1,"Center");
this.add(panel,"South");
this.add(menubar1,"North");
this.setSize(700,500);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
Drawpanel Draw = new Drawpanel();
Draw.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?