由买买提看人间百态

topics

全部话题 - 话题: applet
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
k*********e
发帖数: 2039
1
来自主题: Java版 - 新手求助applet问题
有两个问题,恳请指点。
第一: 写好的applet文件,编译后会产生好几个文件,比如applet.class, applet$1.
class,之类的。打成applet.jar包。然后用ie打开,只能找到applet.class,别的编
译出来的class统统找不到,这是为什么?html里面我写的是 code="applet.class"
archive="applet.jar"。
第二: 如何在同一个ie页面里面实现,运行不同的GUI。比如说,开始打开ie,运行的
是login的GUI。点击登陆之后,会显示下一步操作的GUI。
问题太菜,往老鸟不要见笑。
m******y
发帖数: 588
2
You need to compile the applet code into XXX.class using jdk.
Then you can use the applet in the html page like



<br /> HTML Test Page<br />


The applet will appear below in a Java enabled browser.

codebase = "."
code = "XXX.class"
name = "TestApplet"
width = "400"
height = "300"
hspace = "0"
vspace = "0"
align = "middle"
>


b*****n
发帖数: 5
3
来自主题: Java版 - Help with Java Swing Applet
Hey,
I uploaded my applet(class file and DB driver and html ). I can see applet
loaded. But it's not working as it should.
My applet is suppose to query DB and then according to the result to draw some
pics in JPanel(using custom painting). It worked well as an application before
I converted it to applet.
My questions are:
1) Do I need to do any big coding change when I change application to applet?
What I mean by that is if it's something related to swing event-dispatching
thread? Should I use
R*******r
发帖数: 104
4
写了半天的程序,就是游戏里显示一个纯图片的dialog,没有decoration的那种,
在local跑得好好的,扔浏览器一看,出来一个java applet window的白色底边,
平时用javaa look and feel是不觉得啥的,可是这种纯贴图游戏是不行的,
想起来这是applet security waring, 去不掉,上signed applet是不能接受的。
只好去掉jdialog,直接把panel加到applet里,这下没有modal了,想来想去,
只好把所有能交互的jcomponent都注册到一个vector里,起对话框的时候
disable, 回来的时候恢复。都干完了,发现背景上的animation会冲掉
前景这个虚假的dialog,只好把这个dialog和背景扔到applet
JLayeredPane的两层里,总算搞定。
现在唯一不像的就是起dialog的时候所有JComponent都会被disabled,
不过不算是大问题。
各位大虾要是知道更高明的方法,吱一声。
c******n
发帖数: 4965
5
【 以下文字转载自 Linux 讨论区 】
发信人: creation (yy), 信区: Linux
标 题: what's wrong with this simple applet?
发信站: BBS 未名空间站 (Mon Feb 20 20:03:02 2006), 站内
发信人: creation (yy), 信区: Programming
标 题: what's wrong with this simple applet?
发信站: BBS 未名空间站 (Mon Feb 20 20:02:57 2006), 转信
import java.awt.*;
public class MyApplet extends java.applet.Applet{
public void init(){
setLayout(new BorderLayout());
add("Center", new MyPane());
}
}
class MyPane extends Panel{}
the browser fails to execute the applet,
if I chan
T*****e
发帖数: 361
6
I guess you don't have to put the jar files in your WEB-INF/lib directory if
you don't use them on the server side. For the purpose of applets, you may
create a directory called "lib" or "applets" in your context root (or any
other place) and use relative path to access them.
For example:
..../ (project root)
..../applets/MyApplet.jar
..../html/MyPage.html
Then in MyPage.html:

Well, I guess you may have tried this already :)
Good luck.
f*******w
发帖数: 407
7
来自主题: BuildingWeb版 - 新手请教 java applet+html 入门级问题
新手请教 java applet+html 入门级问题
我已经设置好了apache 服务器,测试显示在“http://localhost:8080/”it works.
现在学习java applet,按照网上的参考写了如下的一段,存为3DGraphics.html :






但是在 http://localhost:8080/3DGraphics.html 却显示不出来:页面有一似是400 x 200的区域,但上面显示Error, Click for Details.
3DGraphics.class 的原code 来自:
http://www.dgp.toronto.edu/~mjmcguff/learn/java/11-3d/
请指教。谢谢!
u*******d
发帖数: 289
8
The problem present by me:
some people including Vadim told me that it is not possible to use an applet
to access Oracle, since then the web server and the DBMS server need to run
on the same host. It's a situtation that I like to avoid.
Answer I get:
Regarding the applet access issue, restriction that an applet can only open
TCP connections to the server it came from. You can get around the problem
by using a servlet on the Web server side that acts as a proxy between the
applet and the Oracle
o**d
发帖数: 11
9
来自主题: Java版 - Re: can Applet use JDBC?
Yes. Applet can use JDBC to make database access. But,
Applet also has lots of security restriction. For example,
it can only make network connections to the host it comes
from. In another word, your database server and web server
needs to be on the machine, which is not always the case. If
your web server and database are located on seperate machine
and you do want your applet to access the database, you can
write an application as a media between the applet and
database.
c*******c
发帖数: 7
10
SORRY I don't mention you are using an applet.
you can try this:
import java.net.*;
import java.applet.Applet;
import java.awt.Graphics;
public class AppletIp extends Applet{
public void AppletIp() {};
public void paint(Graphics g) {
InetAddress host=null;
try {host=InetAddress.getLocalHost();
} catch (Exception e) {}
String ip=host.getHostAddress();
System.out.print("IP: "+ip);
showStatus(ip);
}
public static void main (String argv[]) throws Exception
{
}
}
it ca
c****u
发帖数: 3277
11
来自主题: Java版 - a question regarding applet
if I want to provide the user "save to local disk" function
in my applet, how to avoid the security problem, since applet
doesn't allow local disk access by default? Is there anyway like this:
when user is trying to save the file, it pops up a warning window and
prompts the user to click yes or no to decide whether to save by
just using applet? I think the similia problem is also true for
the applets doing file transfer.
Thanks a lot.
b*****n
发帖数: 5
12
来自主题: Java版 - Help-applet access remote database
Hi,
I have an applet which I want to put on the client side. The main function of
this applet is to query database and draw some graphic navigation interface.
It works fine when I tested with application.However once I changed it to
applet, it has error( Java.security.AccessControl Exception:Access Denied,
Java.net.socket Permission "my db server address" resolve). I know it is
caused by java sand box security problem. I also learned online that the
possible solution is to use signed applet o
e******r
发帖数: 220
13
Implement an applet greeting card. The applet first displays some kind of
graphical depiction (not just an image that you import), then when a user
clicks on the applet it should repaint with the inside of the card displaying
a message in text.
I have done with the applet, but how to add that mouse-click function on it?
Who can give me some hints? Thanks
T*****e
发帖数: 361
14
http://java.sun.com/docs/books/tutorial/deployment/applet/lifeCycle.html
Windows Xp Home
IE6/FF1.5
JDK 1.5.0_6
Error message:
load: class Simple.class not found.
java.lang.ClassNotFoundException: Simple.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Sour
k******4
发帖数: 73
15
编了一个applet 可以在eclipse上面用applet viewer运行 但是无法在ie上运行
搜索了一下 原因在于使用了swing 而ie无法进行编译
需要对html文件进行修改
下面是html文件的代码


A SIMPLE APPLET Example1


HERE IS THE OUT PUT OF MY PROGRAM




试了好久都没成功 很郁闷
本人是非cs专业的菜鸟 希望各位高手帮帮忙 多谢拉
f*******w
发帖数: 407
16
新手请教 java applet+html 入门级问题
我已经设置好了apache 服务器,测试显示在“http://localhost:8080/”it works.
现在学习java applet,按照网上的参考写了如下的一段,存为3DGraphics.html :






但是在 http://localhost:8080/3DGraphics.html 却显示不出来:页面有一似是400 x 200的区域,但上面显示Error, Click for Details.
3DGraphics.class 的原code 来自:
http://www.dgp.toronto.edu/~mjmcguff/learn/java/11-3d/
请指教。谢谢!
z*********e
发帖数: 10149
17
I'm following this java tutorials- Getting Started WIth Applets
here are my files:
======================================
HelloWorld.java
import javax.swing.*;
import java.lang.reflect.InvocationTargetException;
public class HelloWorld extends JApplet{
public void init(){
try {
SwingUtilities.invokeAndWait(new Runnable(){
public void run(){
JLabel label = new JLabel("Hello World!");
add(label);
}
... 阅读全帖
b***i
发帖数: 3043
18
其他电脑上可以看到该applet,也能看到我存到微软officelive上同一个网页的另一个
网上找的applet,是个原子核外电子绕着转那个
我的电脑上ie可以看,firefox不能,也不能看到原子那个,就看到java调入那个转圈
的图案,然后弹出窗口,有时说truncated class file,有时说class not found. 但
是,firefox可以看到sun的例子applet,比如那个小企鹅翻跟头那个。
还有sun的那些例子如果是jnlp文件也是可以的。
这是怎么回事呢?
c*******c
发帖数: 7
19
This can only create self-signed applet. It is useful for
testing purposes. For use of public reachable applets, there
will be needed a "real" certificate issued by an authority
like VeriSign or Thawte.
See details on how to sign an applet at:
http://forum.java.sun.com/read/16803020/qAq2AUAbu0IoAAY0J#LR
yb
发帖数: 171
20
【 以下文字转载自 Windows 讨论区,原文如下 】
发信人: yb (玉月), 信区: Windows
标 题: A problem about ppt and applet
发信站: The unknown SPACE (Wed May 21 14:16:09 2003) WWW-POST
I downloaded an applet (xxx.html and xxx.jar). Does anyone know how to include
this applet in powerpoint?
Thank you very much!
f*******l
发帖数: 73
21
我想用JAVA
APPLET设计一个有图像界面的交互式的小程序(比如有几个按扭,按下后,reload几幅不同
的图). 我用visual c++做过简单的界面设计,很方便.想着visual J++应该也挺容易的.但
是,在我选择了Java Applet的Project后,所有的可视化的control都不能选了.如果我选择
的是windows application的Project,就可以同我以前用visual c++一样的方便的用那些
可视化的控件了.
请问,在visual J++ 下是不是不能用可视化的控件做Java Applet.如果是,有什么别的软
件可以用吗?我知道可以自己直接写,但要自己计算每个按钮的大小,位置等等,还是挺不方
便的.在次多谢了.
s******e
发帖数: 493
22
来自主题: Java版 - Applet如何调用Server side Jar?
server sockets.
javafx will bring applet back to life. But a big question is that if javafx
web stuff will have all the crappy features that applet was criticized from
day one.
acutually flex runtime is pretty much like applet. I always try to persuade
myself that if flex can be successful with their terrible runtime library,
why not sun?
k*********e
发帖数: 2039
23
来自主题: Java版 - 新手求助applet问题
就是一个页面,里面一个button,一点击,handle一个listener,system exit.
编译后,会有两个class文件,applet.class跟applet$handler.class
用ie运行的时候,就找不到applet$handler.class,所以那个button就没有功能了。
程序没什么问题,netbean里都能实现功能,我问了好多人,都说找不到的话,肯定是
path有问题,哎,问题太低级了
s******e
发帖数: 493
24
basically, by default, applet runs in sandbox. which subjects java security
checks. you can google to see what are limited when loading applet to a
broswer. Signed applet will allow you step out of sandbox.
java web start is a tool to help you efficiently get most recent version of
the application. To do it, you have to configure a jnlp file on the server
side and also you need to add some entry to let your web server (not web
container) regonize the file mime type. to use jws, you have to sign
m******o
发帖数: 774
25
写了个并不复杂的applet,自己的jar file一个(digital.jar),需要其它两个lib jar
(dpotapi.jar, dpotjni.jar)。我靠,中文写这个实在不行。
Everything worked perfectly, however, I hate the fact that I must place the
same jar files at two places to make it work. It is deployed under JBoss as
a WAR file, however, I must store the same 3 jar files in both the myapp.war
directory and the myapp.war/WEB-INF/lib directory to make the applet work.
I have tried more than 3 hours with all possible combination I can think of
with the applet tag:
c**t
发帖数: 2744
26
来自主题: Programming版 - 问java applet的问题
so bad, it seems impossible:
Java intentionally severely limits your access to JVMs running applets. Java
applets can't access the client-side filesystem, and I'm fairly sure that
there is absolutely no way to access a client-side event queue either.
I would strongly recommend looking into the RMI, and trying to collaborate
with the 3rd-party applet's vendor. If you're attempting what I think you
are, Java won't allow it. Its web platform assumes that all systems involved
in any sort of transact
l***x
发帖数: 393
27
来自主题: Apple版 - Mac OS X上运行java applet
运行完后,在浏览器中再访问有applet的网页时应该就不会再出现Missing Applet的图
m***a
发帖数: 198
28
来自主题: Java版 - Re: How to showStatus in Applet?
You can put it in start(), however, when your mouse leaves
the applet, the status bar may be forced to show some other
messages (i.e., when you mouse over a HTML link).
To keep it showing "Don't hit me", you need to call
showStatus(), say, every second. The most common way is to
start an other thread to do this job.
public class MyApplet extends Applet implements Runnable{
public void run(){
while(true){
showStatus(...);
Thread.sleep(1000);
}
}
public void start(){
...
new Thread(this).start
m*****e
发帖数: 126
29
来自主题: Java版 - Re: access host file in applet
Applet is subject to security restrictions and usually can not
access files on client. There are sevetal things you are do.
(1) You can pack the supporting files into a 'jar' file and use
the 'archive' attribute in the html code to load the files.
(2) Applet is able to make network connections to the host machine
where it come from. You can read supporting files from a URL.
I think the first method is good for loading a few image files.
The second one is useful when you have many supporting file
l******d
发帖数: 1
30
来自主题: Java版 - Re: 关于APPLET的IO问题
我试了一下,没问题呀。就是IE5的VM好像不合spec,getDocumentBase()连文件名都返回了。所以做了点改动。这是我试验的Code,你参考一下。
MyApplet.java:
import java.io.*;
import java.net.*;
import java.awt.*;
import java.applet.*;
public class MyApplet extends Applet
{
public void init()
{
setLayout(null);
setSize(426,266);
add(textArea1);
textArea1.setBounds(20,20,600,440);
textArea1.setText(getDocumentBase()+"\n");
try {
URL url = new URL(getDocumentBase(), "text.txt");
textArea1.setText(url.toString()+"\n");
URLConnection conn = url.openConnection()
o**k
发帖数: 5
31
来自主题: Java版 - Island java applet bookviewer
How to implement a applet similar to island java book viewer? I want the applet consistantly access database and display result dynamically. Any suggestions?
y**w
发帖数: 8
32
来自主题: Java版 - hwo to insert vedio into Java applet
hi, I had a video and want to insert my java applet. anyone know how to do
that?
from the book i can only see how to insert animation into applet, if i can
convert the video into a series of .gif file , that would also work, but how?
Thanks.
x****g
发帖数: 24
33
来自主题: Java版 - Local file access issue with Applet
I wrote an applet in my own embedded web server(designed using Zilog eZ80 L92)
and run it on IE 5.5. The function of this applet is to open an file from the
local disk and download it to my web server, also upload data from my web
server and save as a file to local disk. The problem is that I was told a file
access denied because of security premission issue. My quesiton is:
Do I have to use policytool to set its ssecurity on local PC? Any other ways
to implement it? If policytool is the only wa
x****g
发帖数: 24
34
来自主题: Java版 - Local file access issue with Applet

Thank you for your information.
1, How to sign applet?
2, after signed, do we have to ask our customers to change some local files or
just sign in my code without asking customers to do anything?
Thanks again!
yes, signed applet. also, he can use java web start, which allows
eZ80
from
web
a
ways
to
t*******l
发帖数: 3662
35
来自主题: Java版 - how do you debug java applet?
i have to write a java applet that can communicate with a server. i am
wondering how you guys debug such java applet from source level?
thanks
xt
发帖数: 17532
36

I didn't say it's worth it. However if you have an obfuscater it takes
only a little script coding to make it happen.
I don't know of PeopleSoft HR system has business logic in applet. I know
their client applet is in megabytes.
i**********r
发帖数: 25
37
来自主题: Java版 - howto disable clipboard in applet
How can I prevent people from copying contents in my applet to their loc
al OS?
For example, I am writing a applet showing a window and a string "Hello
world" in that window. How can I prevent people from copying "Hello worl
d" to their local OS?
Many thanks!
R*******r
发帖数: 104
38
来自主题: Java版 - howto disable clipboard in applet
If you paint it, people can't copy it with copy/paste.

How can I prevent people from copying contents in my applet to their loc
al OS?
For example, I am writing a applet showing a window and a string "Hello
world" in that window. How can I prevent people from copying "Hello worl
d" to their local OS?
Many thanks!
F**e
发帖数: 593
39
on the client side, I have an applet which gets data from backend/server
side.
The data on the server keeps changing. What is the best way to get up-to-
date data on the applet side?
Options I see: polling, RMI, JMS, other options?
什么办法最efficient而且又不难做?先谢了。
P********l
发帖数: 29
40
来自主题: Java版 - 关于applet下的中文乱码问题
我用php调用一个applet上传文件,当选择中文文件名时候得到的是乱码.
我没有applet的源文件,但它似乎是用ISO-8859-1编码的,我的php程序是utf8的编码.可
是无论怎么转换都不能得到正确的中文,请指教,谢谢.
Z******h
发帖数: 89
41
I have tried to run applet with the following link:
http://www.netbeans.org/kb/61/web/applets.html
But it didn't work. Any suggestions? Thanks
A**o
发帖数: 1550
42
来自主题: Java版 - 新手求助applet问题
自学的话就不要研究applet了,工作这么多年,我唯一的applet的知识
都是来自学校里的作业,然后就再也没用过了。
不过你可以把你的代码贴出来或者上传上来,说不定有人会帮你看看。

的。
g*****g
发帖数: 34805
43
applet干不了这个,非要干的话要改permission file.
你去google一下applet security restriction就知道了。
g*****g
发帖数: 34805
44
applet viewer是用来测试用的,基本上就是把applet当作application
跑,所以没有这问题。
l********0
发帖数: 283
45

Applet有数字签名,使用数字签名就可以解决applet的沙箱权限
b***i
发帖数: 3043
46
来自主题: Java版 - java applet找不到文件
从网上下的,在windows上本地看正常,放ubuntu apache上,远程看,说没有找到一个
文件,这个文件是通过 我又用windows apache,远程看,没有问题。ubuntu本地看也找不到这个文件,ubuntu
直接看网上原来的applet也没有问题。
现在问题是不是大小写的问题呢?有没有类似经历的同修?
b***i
发帖数: 3043
47
来自主题: Java版 - java applet找不到文件
用appletviewer没有任何问题,这样就无法发现问题了,我原来想debug,
用firefox如何debug java applet?能文本输出吗?是别人写的程序,很大的项目,难
道是firefox+ubuntu?因为单独ubuntu我applet viewer可以正常运行,firefox看网上
那个人的没有问题,就是在ubuntu上本地用firefox看出了问题,还有,我用ubuntu+
apache就不能再pc上看了。
g*****g
发帖数: 34805
48
Applet runs locally on your machine, so no, you cannot do that directly.
But you can always have a server programm running on the hosting server
talking to your applet and let the sever program writes it.
b***i
发帖数: 3043
49
我这个applet很大,450kB
放在网上,点击后,很快就载入,显示了java loading,完成后,弹出了我最开始的几
个JOptionPane,来选择一些设定。然后,当我的程序启动主窗口的时候,这个是另一
个类的实例,要另开一个窗口,不是applet最外层的那个类,这中间要等10秒钟。为什
么呢?
我弹出JOptionPane的时候,确实在读入一些资源文件,总共大约120kB的样子,都是图
标。这个可以一边互动设定选项,一边载入的。可是为什么最后的窗口要等10秒钟才开
呢?
b***i
发帖数: 3043
50
来自主题: Java版 - java applet读网络文件的问题
java applet放在服务器上,在客户端运行,应该可以读取同服务器上的文件吧。我在
微软officelive上就可以这么做。
后来搬到godaddy上。一开始试了好多次终于可以的,可是今天却不行了。我用的读文
件的程序是
URL url=TPTest.class.getResrouce("/test.txt");
结果url是空的。
如果我用
URL url=new URL("http://www.myaddress.info/test.txt");
try{
InputStream in= url.openStream();
就java.security.AccessControlException: access denied (java.net.
SocketPermission aa.b.ccc.dd:80 connect,resolve)
其中,我掩盖了我的地址,这个地址是纯数字,不是原来字母形式的。
关键吧,有一天就可以,现在则不行。显然我的applet要读取的就是本身服务器上面的
文件,怎么会出现这些麻烦事呢?怎么解决呢?多谢了先。
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)