我照教程写了个程序,编译没问题,但一运行就提示有致命错误,具体提示如下:## 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);
}
}
源码是按教程写的,在别的机器上试过,没问题。但为了大家看到更明白也贴出来,如下:
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);
}
}
上了这个网站看了下,好像是jdk7里面有待于完善的部分,为了jdk7的改进可以去,反映这个问题
程序应该是没有问题。
但是4楼哥们说的那个问题我还真没试过。不知道楼主是不是用的j7?如果是的换成6试试