good news...u know what, just now i tried to add "." to the classpath and it works...but still dont know why...

breathe (breathe)
b4 i set classpath to: c:\dir;.;c:\jdk..\rt.jar and ran the applet from a: and c:.
a: worked and c: funtioned weird (buttons only functioned once). later i
set classpath only to c:\..rt.jar and got the same result.

now i set it to .;c:\...rt.jar and both (a & c) work.

so my guessing is that it's sth related to classpath. but why? i've got
more than one Date class under c:\dir. but i dont think it really matters
coz everytime b4 i run the applet i always compile the related Date file.
i think that if the compiler finds multiple files with the same name, it will look at each file's compiling time to decide which one to use. but now
it looks like i have to explicitly specify the classpath. even so, it still cant
explain the weird behaviour of those buttons...

2001-10-29 -04:00

回到话题: 初级java问题请教...

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论