java小问题(java.awt.toolkitt)

java小问题_百度知道
java小问题
可是那一堆Button都不见了;
public void paint(Graphics g){
T),0,代码如下;1.getImage(&quot,this),上面是一堆JButton.image =
this,而且,消除button的时候,0,想在JPanel上加点图片;
MyPanel(){
toolkit = this,我赶时间啊public class MyPanel extends JPanel{
private Image image,button才会出来,求救:但是出来后背景图片是有了,好郁闷.jpg&quot,只有当鼠标移到那个位置,背景是JPanel,做一个简单的连连看求救啊.toolkit.getToolkit(),会残留button.drawImage(image
有的就加不上,程序没问题,我的button上面加图标,你确实是对的,但是你能告诉我为什么这样就可以了呢,你太强了,怎么回事啊还有,有的能加,都没人能答出来?兄弟
提问者采纳
paintComponent(g), 0.image =), 0.drawImage(image,看看能解决多少问题.public class MyPanel extends JPanel{ private I1; } protected void paintComponent(Graphics g) {
super.jpg& MyPanel(){ toolkit = this.getImage(&quot. this.getToolkit(); Toolkit toolkit你将程序改成如下模样, this)
其他类似问题
为您推荐:
您可能关注的推广
java的相关知识
其他1条回答
........kanbudong.
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Java虚拟机的问题,请各位大虾看看 - 开源中国社区
当前访客身份:游客 [
当前位置:
关闭的时候出现错误:
窗体宽:400窗体高:300
# A fatal error has been detected by the Java Runtime Environment:
# &EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100a72b7, pid=160, tid=1248
# JRE version: 7.0_03-b05
# Java VM: Java HotSpot(TM) Client VM (22.1-b02 mixed mode, sharing windows-x86 )
# Problematic frame:
# C &[GOOGLEPINYIN2.IME+0xa72b7]
# 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:
# E:\java\workspace\Example\hs_err_pid160.log
# If you would like to submit a bug report, please visit:
# & /bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
文件hs_err_pid160.log如下:
# A fatal error has been detected by the Java Runtime Environment:
# &EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100a72b7, pid=3416, tid=3528
# JRE version: 7.0_03-b05
# Java VM: Java HotSpot(TM) Client VM (22.1-b02 mixed mode, sharing windows-x86 )
# Problematic frame:
# C &[GOOGLEPINYIN2.IME+0xa72b7]
# 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:
# & /bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
--------------- &T H R E A D &---------------
Current thread (0x02f8f400): &JavaThread &AWT-Windows& daemon [_thread_in_native, id=3528, stack(0x031d20000)]
siginfo: ExceptionCode=0xc0000005, reading address 0x
Registers:
EAX=0x, EBX=0x0696bc08, ECX=0x, EDX=0x
ESP=0x0321f77c, EBP=0x, ESI=0x, EDI=0x
EIP=0x100a72b7, EFLAGS=0x
Top of Stack: (sp=0x0321f77c)
0x0321f77c: & a4aba
0x0321f78c: & d4 100a5062
0x0321f79c: & 1f7b4 0a5010
0x0321f7ac: &
0x0321f7bc: &
0x0321f7cc: & 100a5010 dcbaabcd 1f81c
0x0321f7dc: & 100a8 77d10
0x0321f7ec: &
Instructions: (pc=0x100a72b7)
0x100a7297: & d8 83 e8 01 83 c4 0c c3 83 c8 ff 83 c4 0c c3 cc
0x100a72a7: & cc cc cc cc cc cc cc cc cc 53 8b 58 04 8b 4b 50
0x100a72b7: & 8b 49 04 56 57 52 e8 ae 9b ff ff 85 c0 74 29 8b
0x100a72c7: & 70 1c 85 f6 74 22 83 78 18 10 72 05 8b 40 04 eb&
Register to memory mapping:
EAX=0x is an unknown value
EBX=0x0696bc08 is an unknown value
ECX=0x is an unknown value
EDX=0x is an unknown value
ESP=0x0321f77c is pointing into the stack for thread: 0x02f8f400
EBP=0x is pointing into the stack for thread: 0x02f8f400
ESI=0x is an unknown value
EDI=0x is an unknown value
Stack: [0x031d20000], &sp=0x0321f77c, &free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C &[GOOGLEPINYIN2.IME+0xa72b7] &ImeGetRegisterWordStyle+0x84647
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j &sun.awt.windows.WToolkit.eventLoop()V+0
j &sun.awt.windows.WToolkit.run()V+49
j &java.lang.Thread.run()V+11
v &~StubRoutines::call_stub
--------------- &P R O C E S S &---------------
Java Threads: ( =& current thread )
& 0x02fb7800 JavaThread &Thread-0& daemon [_thread_in_native, id=504, stack(0x07aab0000)]
& 0x00866c00 JavaThread &DestroyJavaVM& [_thread_blocked, id=2088, stack(0xx009a0000)]
& 0x02fa9000 JavaThread &AWT-EventQueue-0& [_thread_blocked, id=2920, stack(0xx)]
& 0x02fa3400 JavaThread &Image Fetcher 0& daemon [_thread_blocked, id=1288, stack(0x037e30000)]
=&0x02f8f400 JavaThread &AWT-Windows& daemon [_thread_in_native, id=3528, stack(0x031d20000)]
& 0x02f8dc00 JavaThread &AWT-Shutdown& [_thread_blocked, id=3264, stack(0xx031d0000)]
& 0x02f8cc00 JavaThread &Java2D Disposer& daemon [_thread_blocked, id=1712, stack(0xx)]
& 0x02c64800 JavaThread &Service Thread& daemon [_thread_blocked, id=3648, stack(0x02eee0000)]
& 0x02c61400 JavaThread &C1 CompilerThread0& daemon [_thread_blocked, id=3972, stack(0x02ee90000)]
& 0x02c5d400 JavaThread &Attach Listener& daemon [_thread_blocked, id=828, stack(0x02dfe40000)]
& 0x02c5bc00 JavaThread &Signal Dispatcher& daemon [_thread_blocked, id=1500, stack(0x02dadf0000)]
& 0x02c3fc00 JavaThread &Finalizer& daemon [_thread_blocked, id=2988, stack(0x02dda0000)]
& 0x02c3b000 JavaThread &Reference Handler& daemon [_thread_blocked, id=3944, stack(0x02dd50000)]
Other Threads:
& 0x02c39800 VMThread [stack: 0x02cbd00000] [id=3876]
& 0x02c68000 WatcherThread [stack: 0x02eef30000] [id=2944]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
&def new generation & total 4928K, used 2086K [0x22a5fafa0000)
& eden space 4416K, &47% used [0x22a5c59ae8, 0x22ea0000)
& from space 512K, & 0% used [0x22eaeaf20000)
& to & space 512K, & 0% used [0x22f2f2fa0000)
&tenured generation & total 10944K, used 0K [0x27faa5a50000)
& &the space 10944K, & 0% used [0x27fafafaa50000)
&compacting perm gen &total 12288K, used 687K [0x32a55a50000)
& &the space 12288K, & 5% used [0x32a5afbee8, 0x32afc000, 0x)
& & ro space 10240K, &42% used [0x36a5e8db28, 0x36e8dc00, 0x)
& & rw space 12288K, &54% used [0xx37ace400, 0x37ace400, 0x)
Code Cache &[0x009da8d0000)
&total_blobs=241 nmethods=46 adapters=131 free_code_cache=32094Kb largest_free_block=
Dynamic libraries:
D:\Java\jre7\bin\javaw.exe
0x7c920000 - 0x7c9b6000
C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c91e000
C:\WINDOWS\system32\kernel32.dll
0x77da0000 - 0x77e49000
C:\WINDOWS\system32\ADVAPI32.dll
0x77e50000 - 0x77ee3000
C:\WINDOWS\system32\RPCRT4.dll
0x77fc0000 - 0x77fd1000
C:\WINDOWS\system32\Secur32.dll
0x77d10000 - 0x77da0000
C:\WINDOWS\system32\USER32.dll
0x77ef0000 - 0x77f39000
C:\WINDOWS\system32\GDI32.dll
C:\WINDOWS\WinSxS\x86_mon-Controls_ccf1df_6.0._x-ww_61e65202\COMCTL32.dll
0x77be0000 - 0x77c38000
C:\WINDOWS\system32\msvcrt.dll
0x77f40000 - 0x77fb6000
C:\WINDOWS\system32\SHLWAPI.dll
C:\WINDOWS\system32\IMM32.DLL
0x62c20000 - 0x62c29000
C:\WINDOWS\system32\LPK.DLL
0x73fa0000 - 0x
C:\WINDOWS\system32\USP10.dll
0x78aa0000 - 0x78b5e000
D:\Java\jre7\bin\msvcr100.dll
0x6d830000 - 0x6db58000
D:\Java\jre7\bin\client\jvm.dll
0x71a40000 - 0x71a4b000
C:\WINDOWS\system32\WSOCK32.dll
0x71a20000 - 0x71a37000
C:\WINDOWS\system32\WS2_32.dll
0x71a10000 - 0x71a18000
C:\WINDOWS\system32\WS2HELP.dll
0x76b10000 - 0x76b3a000
C:\WINDOWS\system32\WINMM.dll
0x76bc0000 - 0x76bcb000
C:\WINDOWS\system32\PSAPI.DLL
0x6d7c0000 - 0x6d7cc000
D:\Java\jre7\bin\verify.dll
0x6d2f0000 - 0x6d310000
D:\Java\jre7\bin\java.dll
0x6d810000 - 0x6d823000
D:\Java\jre7\bin\zip.dll
0x6d000000 - 0x6d142000
D:\Java\jre7\bin\awt.dll
0x770f0000 - 0x
C:\WINDOWS\system32\OLEAUT32.dll
0x - 0x76ace000
C:\WINDOWS\system32\ole32.dll
0x5adc0000 - 0x5adf7000
C:\WINDOWS\system32\uxtheme.dll
0x - 0x673ef000
D:\360\360Safe\safemon\safemon.dll
0x7d590000 - 0x7dd84000
C:\WINDOWS\system32\SHELL32.dll
0x77bd0000 - 0x77bd8000
C:\WINDOWS\system32\VERSION.dll
0x3e410000 - 0x3e4f6000
C:\WINDOWS\system32\WININET.dll
C:\WINDOWS\system32\Normaliz.dll
0x43ce0000 - 0x43e13000
C:\WINDOWS\system32\urlmon.dll
0x3eab0000 - 0x3ec9b000
C:\WINDOWS\system32\iertutil.dll
0x - 0x746cc000
C:\WINDOWS\system32\MSCTF.dll
C:\WINDOWS\system32\msctfime.ime
C:\WINDOWS\system32\GOOGLEPINYIN2.IME
0x765e0000 - 0x
C:\WINDOWS\system32\CRYPT32.dll
0x76db0000 - 0x76dc2000
C:\WINDOWS\system32\MSASN1.dll
0x76c00000 - 0x76c2e000
C:\WINDOWS\system32\WINTRUST.dll
0x76c60000 - 0x76c88000
C:\WINDOWS\system32\IMAGEHLP.dll
0x762f0000 - 0x762f5000
C:\WINDOWS\system32\MSIMG32.dll
0x4ae90000 - 0x4b03b000
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_ccf1df_1.0._x-ww_c8dff154\gdiplus.dll
0x68d60000 - 0x68e01000
C:\WINDOWS\system32\dbghelp.dll
0x759d0000 - 0x75a7f000
C:\WINDOWS\system32\USERENV.dll
0x6d240000 - 0x6d26a000
D:\Java\jre7\bin\fontmanager.dll
0x76fa0000 - 0x
C:\WINDOWS\system32\CLBCATQ.DLL
0x - 0x770ba000
C:\WINDOWS\system32\COMRes.dll
0x5dd50000 - 0x5de73000
C:\WINDOWS\system32\msxml3.dll
VM Arguments:
jvm_args: -Dfile.encoding=GBK&
java_command: example10.MainFrame
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=D:\Java
PATH=D:/Java/jre7/bin/D:/Java/jre7/D:/Java/jre7/lib/i386;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\WD:\MinGW\C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;D:\Java\jdk1.7.0_03\D:\Java\jre7\;F:\
USERNAME=yin
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 42 Stepping 7, GenuineIntel
--------------- &S Y S T E M &---------------
OS: Windows XP Build 2600 Service Pack 3
CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 42 stepping 7, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt
Memory: 4k page, physical 5188k free), swap 99672k free)
vm_info: Java HotSpot(TM) Client VM (22.1-b02) for windows-x86 JRE (1.7.0_03-b05), built on Feb &3 :37 by &java_re& with unknown MS VC++:1600
time: Sun Jun 24 22:17:56 2012
elapsed time: 1 seconds.
请各位高手看看,是什么问题?谢谢
共有1个答案
<span class="a_vote_num" id="a_vote_num_
我不是高手!但很想知道你想问什么
更多开发者职位上
有什么技术问题吗?
类似的话题Java中Toolkit.getDefaultToolkit()的原理_百度知道
Java中Toolkit.getDefaultToolkit()的原理
Toolkit是抽象类,所以不能用new Toolkit()实例化对象。但是Toolkit有静态方法getDefaultToolkit(),通过这个方法可以获取到Toolkit的对象。具体的你可以看jdk文件下的src.zip包中的源码(src.zip&#92;java&#92;awt &#92;Toolkit.java 第852行(不要用记事本打开,用EditPlus或者notepad++打开)) 可以看到getDefaultToolkit()方法是通过反射机制获得的Toolkit类的对象的。。
其他类似问题
为您推荐:
Toolkit类中,他的构造方法被私有化了 被private了,这样的话在外部就没办法直接new一个对象出来。那么怎么实例化它呢?此类中还提供了一个静态方法(Toolkit.getDefaultToolkit();
)来调用他的构造方法(private的方法在自己的类中是可以访问的),此静态方法返回一个此类的对象。所以只能用getDafaultToolkit()方法得到对象了。这种设计模式在java中很常见,叫做单例设计模式,为什么采用这种设计模式呢?比如说就toolkit这样一个工具对象,你new多了有没有用?没用!它只是能帮你返回一些系统信息,不能帮你储存数据,不能帮你干别的事儿你也不能对它做什么修改,那么它就不需要有很多个,一个项目中有一个就够你用了,多的话只是空浪费内存浪费系统资源。那么怎么能不让用户new出来很多这样的对象呢?那...
岸芷汀兰,信步留香。千尺长廊,瀑流鸣响。砯崖转石,钧雷铿锵。珠玉映辉,溢彩流光。浮光跃金,江。玉兔东升,华灯初上。月照九州,星耀八荒。中秋佳节,盛举共襄。玉溪璀璨,红塔辉煌。河滨水畔,影泛金光。举目远望,金龙腾江。微风抚岸,振鳞欲翔。欲翔又止,难舍风光。鲤跃龙门,翘首遥望。
java的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁java小问题(Toolkit)_百度知道
java小问题(Toolkit)
pgn&.getImage(&d&&#92;)?images&#92.getDefaultToolkit();&#92;中的图片应该放在哪里;+i+&d是什么意思pic[i]=Timages&#92
提问者采纳
&#92;意思是images&#47。至于要放到哪里要看你在后面会怎么处理;是转义字符;d1这句话只是把图片读取到程序里了;d这个是路径;.pgn&#92;&#92,意思是&#47;images&#92
提问者评价
来自团队:
其他类似问题
为您推荐:
java的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 java split 竖线 问题 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信