程序没问题,但运行的时候窗口闪一下,提示有致命错误。
光羽炎 2012-07-29 03:51:37 我照教程写了个程序,编译没问题,但一运行就提示有致命错误,具体提示如下:## A fatal error has been detected by the Java Runtime Environment:## EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x746905c7, pid=492, tid=1788## JRE version: 7.0_05-b06# Java VM: Java HotSpot(TM) Client VM (23.1-b03 mixed mode, sharing windows-x86 )# Problematic frame:# C [MSCTF.dll+0x105c7] TF_DllDetachInOther+0x12e5## Failed to write core dump. Minidumps are not enabled by default on client versions of Windows## 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.
源码是按教程写的,在别的机器上试过,没问题。但为了大家看到更明白也贴出来,如下:
package com.rong.test;
import java.awt.*;
public class MyFrame extends Frame {
public static void main(String[] args) {
new MyFrame().launchFrame();
}
public void paint(Graphics g) {
g.setColor(Color.BLUE);
g.fillOval(30, 30, 50, 50);
}
public void launchFrame() {
this.setBounds(400, 400, 300, 300);
this.setVisible(true);
}
}