📄 shapetestframe.java
字号:
/*
* Created on 2005-9-1
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author gerally
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ShapeTestFrame extends JFrame {
public ShapeTestFrame()
{
setTitle("ShapeTest");
setSize(WIDTH, HEIGHT);
Container contentPane = getContentPane();
final ShapePanel panel = new ShapePanel();
contentPane.add(panel, BorderLayout.CENTER);
final JComboBox comboBox = new JComboBox();
comboBox.addItem(new LineMaker());
comboBox.addItem(new RectangleMaker());
comboBox.addItem(new RoundRectangleMaker());
comboBox.addItem(new EllipseMaker());
comboBox.addItem(new ArcMaker());
comboBox.addItem(new PolygonMaker());
comboBox.addItem(new QuadCurveMaker());
comboBox.addItem(new CubicCurveMaker());
comboBox.addActionListener(new
ActionListener()
{
public void actionPerformed(ActionEvent event)
{
ShapeMaker shapeMaker =
(ShapeMaker)comboBox.getSelectedItem();
panel.setShapeMaker(shapeMaker);
}
});
contentPane.add(comboBox, BorderLayout.NORTH);
}
private static final int WIDTH = 300;
private static final int HEIGHT = 300;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -