黑马程序员技术交流社区

标题: 图形界面编程问题 [打印本页]

作者: 丁一    时间: 2013-3-27 20:37
标题: 图形界面编程问题
本帖最后由 丁一 于 2013-3-28 08:13 编辑
  1. import java.awt.*;
  2. import java.awt.event.*;

  3. public class MyFrame {
  4.         public static void main(String [] args)
  5.         {               
  6.                 Frame f = new Frame("my awt");
  7.                     f.setSize(200,200);                        
  8.                     f.setLocation(100,100);
  9.                     f.setLayout(new FlowLayout());
  10.                     Button b1 =new Button("关闭");
  11.                     f.add(b1);
  12.                     
  13.                     f.addWindowListener(new WindowAdapter()
  14.                     {
  15.                             public void windowClosing(WindowEvent e)
  16.                           {
  17.                                   System.exit(0);
  18.                           }                                                
  19.                     });
  20.                     f.setVisible(true);
  21.                     
  22.         }

  23. }
复制代码
这段程序在Eclipse 中执行 完 显示下面信息,都啥意思啊? 什么错误啥的
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6fee72b7, pid=2440, tid=8972
#
# JRE version: 7.0_17-b02
# Java VM: Java HotSpot(TM) Client VM (23.7-b01 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [GOOGLEPINYIN2.IME+0xa72b7]  ImeGetRegisterWordStyle+0x84647
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\Java\Demo\hs_err_pid2440.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#


作者: 王小丑    时间: 2013-3-27 20:59
{:soso_e100:}
作者: 我手心里的宝    时间: 2013-3-27 21:04
你首先创建窗体,在添加监听器
你这样窗体还没有,怎么弄监听器呢
或许我说的不对,建议你再看看视频
作者: 丁一    时间: 2013-3-27 21:11
我手心里的宝 发表于 2013-3-27 21:04
你首先创建窗体,在添加监听器
你这样窗体还没有,怎么弄监听器呢
或许我说的不对,建议你再看看视频 ...

和毕老师的一样啊,运行毕老师写的也出现一堆提示,是不是我的计算机配置问题




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2