JAVA设置字体菜单的代码是?

来源:百度知道 编辑:UC知道 时间:2024/05/15 19:10:15
急!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

class ExitWindow extends WindowAdaper
应该是class ExitWindow extends WindowAdapter

改了一些你的代码
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class MiniDrawPad extends JFrame {
private JButton choices[];
private String names[]={
"New",
"Open",
"Save",
"Pencil",
"Line",
"Rect",
"fRect",
"Oval",
"fOval",
"Circle",
"fCircle",
"RoundRect",
"frRect",
"Rubber",
"Color",
"Stroke",
"Word" };

private Icon items[];

JToolBar buttonPanel ; //定义按钮面板
private JLabel statusBar; //显示鼠标状态的提示条

private DrawPanel drawingArea; //画图区域
private int width=800,height=550; //定义画图区域初始大小

JCheckBox bold,itali