java吧 关注:1,272,357贴子:12,781,290
  • 6回复贴,共1

这个我写的哪错了这么不能运行啊~求指点

只看楼主收藏回复

import java.awt.*;
import java.awt.event.*;
public class app13_1 extends Frame implements ActionListener{
static app13_1 frm = new app13_1();
static Button bt=new Button("设置字体颜色");
static TextArea ta = new TextArea("字体颜色",5,20);
public static void mian(String[] args){
bt.addActionListener(frm);
frm.setTitle("操作事件");
frm.setLayout(new FlowLayout());
frm.setSize(260,170);
frm.add(ta);
frm.add(bt);
frm.setVisible(true);
}
public void actionPerformed(ActionEvent e){
ta.setForeground(Color.red);
}
}



IP属地:北京1楼2012-05-31 15:39回复
    public static void mian(String[] args){
    改为
    public static void main(String[] args){


    IP属地:上海2楼2012-05-31 15:43
    回复
      2025-08-03 17:26:09
      广告
      不感兴趣
      开通SVIP免广告
      擦,我的眼都疲劳了~


      IP属地:北京3楼2012-05-31 15:46
      回复


        IP属地:上海4楼2012-05-31 15:47
        回复
          主方法名称拼错了


          5楼2012-05-31 16:18
          回复
            LZ
            你火了


            IP属地:云南6楼2012-05-31 16:53
            回复