Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 JOptionPane的奇怪出错
cxp108





发贴: 363
积分: 12
于 2003-10-14 10:58 user profilesend a private message to usersend email to cxp108search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
在Applet中编写以下代码
public class ClusterParaDialog extends JDialog{
.
.
.
.
private class cycleSaNoTFInputVerifier extends InputVerifier{
.
.
.
JOptionPane.showMessageDialog(ClusterParaDialog.this,"content","dialog",JOptionPane.INFORMATION_MESSAGE);
.
.
.
.


.
.
}
编译通过了
运行环境:JRE 1.3.1 就不会出现问题,显示正常
但是运行环境1.4.0~2版本的JRE会出现以下问题:

----------------------------------------------------------------------------------------
Exception occurred during event dispatching:

java.lang.StackOverflowError

  at sun.java2d.Disposer.add(Disposer.java:91)

  at sun.java2d.Disposer.addRecord(Disposer.java:68)

  at sun.awt.windows.Win32SurfaceData.initOps(Native Method)

  at sun.awt.windows.Win32SurfaceData.<init>(Win32SurfaceData.java:432)

  at sun.awt.windows.Win32SurfaceData.createData(Win32SurfaceData.java:311)

  at sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:321)

  at sun.awt.windows.WComponentPeer.setBounds(WComponentPeer.java:133)

  at sun.awt.windows.WComponentPeer.initialize(WComponentPeer.java:523)

  at sun.awt.windows.WCanvasPeer.initialize(WCanvasPeer.java:63)

  at sun.awt.windows.WPanelPeer.initialize(WPanelPeer.java:57)

  at sun.awt.windows.WWindowPeer.initialize(WWindowPeer.java:81)

  at sun.awt.windows.WDialogPeer.initialize(WDialogPeer.java:48)

  at sun.awt.windows.WComponentPeer.<init>(WComponentPeer.java:497)

  at sun.awt.windows.WCanvasPeer.<init>(WCanvasPeer.java:29)

  at sun.awt.windows.WPanelPeer.<init>(WPanelPeer.java:53)

  at sun.awt.windows.WWindowPeer.<init>(WWindowPeer.java:77)

  at sun.awt.windows.WDialogPeer.<init>(WDialogPeer.java:26)

  at sun.awt.windows.WToolkit.createDialog(WToolkit.java:368)

  at java.awt.Dialog.addNotify(Dialog.java:387)

  at java.awt.Window.pack(Window.java:428)

  at javax.swing.JOptionPane.createDialog(JOptionPane.java:899)

  at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:819)

  at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:624)

  at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:595)

  at com.cet.ui.ctcui.ClusterParaDialog$cycleSaNoTFInputVerifier.verify(ClusterParaDialog.java:1833)

  at javax.swing.InputVerifier.shouldYieldFocus(InputVerifier.java:114)

  at javax.swing.JComponent.runInputVerifier(JComponent.java:1104)

  at javax.swing.JComponent.requestFocus(JComponent.java:1109)

  at javax.swing.plaf.basic.BasicOptionPaneUI.selectInitialValue(BasicOptionPaneUI.java:849)

  at javax.swing.JOptionPane.selectInitialValue(JOptionPane.java:2126)

  at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:821)

  at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:624)

  at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:595)

  at com.cet.ui.ctcui.ClusterParaDialog$cycleSaNoTFInputVerifier.verify(ClusterParaDialog.java:1833)

  at javax.swing.InputVerifier.shouldYieldFocus(InputVerifier.java:114)

  at javax.swing.JComponent.runInputVerifier(JComponent.java:1104)

  at javax.swing.JComponent.requestFocus(JComponent.java:1109)

  at javax.swing.plaf.basic.BasicOptionPaneUI.selectInitialValue(BasicOptionPaneUI.java:849)

  at javax.swing.JOptionPane.selectInitialValue(JOptionPane.java:2126)

  at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:821)

  at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:624)

  at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:595)

  at com.cet.ui.ctcui.ClusterParaDialog$cycleSaNoTFInputVerifier.verify(ClusterParaDialog.java:1833)

  at javax.swing.InputVerifier.shouldYieldFocus(InputVerifier.java:114)

  at javax.swing.JComponent.runInputVerifier(JComponent.java:1104)

  at javax.swing.JComponent.requestFocus(JComponent.java:1109)

  at javax.swing.plaf.basic.BasicOptionPaneUI.selectInitialValue(BasicOptionPaneUI.java:849)

  at javax.swing.JOptionPane.selectInitialValue(JOptionPane.java:2126)

  at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:821)

  at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:624)

  at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:595)

  at com.cet.ui.ctcui.ClusterParaDialog$cycleSaNoTFInputVerifier.verify(ClusterParaDialog.java:1833)
........
------------------------------

这个问题困扰了小弟很久,希望众大虾们帮着做个试验,看看到底是不
是JRE的问题,还是小弟代码写得不当所至。




话题树型展开
人气 标题 作者 字数 发贴时间
4468 JOptionPane的奇怪出错 cxp108 4362 2003-10-14 10:58
2730 Re:JOptionPane的奇怪出错 jameszhang 55 2003-10-15 19:30
2774 Re:JOptionPane的奇怪出错 floater 160 2003-10-15 22:06

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2018 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号
客服电话 0592-8750026    客服信箱 714923@qq.com    客服QQ 714923