This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / 初级java问题请教...一applet, 从a:打开,可以运行自如。可是,同样文件,如从c:打开,
虽然也可以,但那些button只反应一次(awt button,是作类似计数用),
也即只能加一次,就再没有反应。
也想过是classpath设置问题。可是应该没有问题,因为两个文件都
可以运行,只是如果从c:打开文件,actionPerformed method似乎只
能执行一次。
一模一样的文件,真是百思不得其解...
请教各位高手为什么?? 谢先了。
-breathe(breathe);
2001-10-28
{372}
(#240542@0)
-
Why not post your source code?
-sailor(Sailor);
2001-10-29
(#241349@0)
-
source code here......
-breathe(breathe);
2001-10-29
{3695}
(#241484@0)
-
可能是临时文件在做怪吧。浏览器发现曾经有过这个文件,就可能不会加载新版本的文件,而使用缓存的旧版本
-miketany(kat);
2001-10-29
(#241509@0)
-
good point, thanks......however,i use textpad to compile and run the applet, so it's the appletviewer that actually runs the applet, not the browser. actually i ftped my applet class and corresponding html file to my homepage. it works as fine as i run it from a: driver.
so back to my question: why those buttons only react ONCE if i open
the file from c: driver? the applet does show up. when the buttons are clicked, they do add a number...but that's it.
exactly the same file, so wired...
-breathe(breathe);
2001-10-29
{471}
(#241572@0)
-
good news...u know what, just now i tried to add "." to the classpath and it
works...but still dont know why...
-breathe(breathe);
2001-10-29
{789}
(#241591@0)
-
原因很简单啊,因为你必须那么做。 因为你的程序编译后有多个文件组成, 如果不把当前路径加进去, 它不会自己到这个目录下去找的。 这是Java的一个特点, 有点像unix
-miketany(kat);
2001-11-3
(#247469@0)