applet

Determine whether client browser has java installed and can launch applets

孤街醉人 提交于 2019-12-17 16:31:18
问题 I am developing an .aspx page which will ultimately launch an applet after the user clicks on a button (I am using the <applet> tag). So, I would like to detect if java is enabled/installed on the user's browser. I am using navigator.javaEnabled() method. However, even though this is working fine on IE7, it is returning inconsistent results on Firefox 3.0.12 (don't know about different browsers), sometimes saying that java is enabled (which it is), and then after launching the applet and

Javascript to Java Applet communication

百般思念 提交于 2019-12-17 16:26:55
问题 I am trying to pass a selected value from HTML drop-down to an Applet method, using setter method in the Applet. But every time the Javascript is invoked it shows "object doesn't support this property or method" as an exception. My javascript code : function showSelected(value){ alert("the value given from"+value); var diseasename=value; alert(diseasename); document.decisiontreeapplet.setDieasename(diseasename); alert("i am after value set "); } My applet code : package com.vaannila.utility;

Java finalize方法使用

一个人想着一个人 提交于 2019-12-17 16:26:30
《 JAVA 编程思想》: Java 提供 finalize () 方法,垃圾回收器准备释放内存的时候,会先调用 finalize() 。 (1).对象不一定会被回收。 (2).垃圾回收不是析构函数。 (3).垃圾回收只与内存有关。 (4).垃圾回收和finalize()都是靠不住的,只要JVM还没有快到耗尽内存的地步,它是不会浪费时间进行垃圾回收的。 有时当撤消一个对象时,需要完成一些操作。例如,如果一个对象正在处理的是非Java 资源,如文件句柄或window 字符字体,这时你要确认在一个对象被撤消以前要保证这些资源被释放。为处理这样的状况,Java 提供了被称为收尾(finalization )的机制。使用该机制你可以定义一些特殊的操作,这些操作在一个对象将要被垃圾回收程序释放时执行。 要给一个类增加收尾(finalizer ),你只要定义finalize ( ) 方法即可。Java 回收该类的一个对象时,就会调用这个方法。在finalize ( )方法中,你要指定在一个对象被撤消前必须执行的操作。垃圾回收周期性地运行,检查对象不再被运行状态引用或间接地通过 其他 对象引用。就在对象被释放之前,Java 运行系统调用该对象的finalize( ) 方法。 finalize()方法的通用格式如下: protected void finalize( ) { //

-tsa or -tsacert timestamp for applet jar self-signed

流过昼夜 提交于 2019-12-17 15:36:19
问题 When I was trying to self-sign in the jar like below. jarsigner -keystore my keystore myjar.jar myalias It gives warning like: No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2014-05-08) or after any future revocation date. Please help to resolve the problem. 回答1: The recent Java 7 provides a (courtesy?) warning about something which has been in place for a decade..

Getting MAC address on a web page using a Java applet

自作多情 提交于 2019-12-17 13:45:27
问题 I want to create an application where a web server can get the MAC Address of the clients logging in. The only possible way I could think of was to create a JAVA applet which contains java.net methods to find the mac address I am using javascript to call the applet methods, but the browser is not allowing those methods to execute. Below is the applet I have created. import java.applet.*; import java.awt.*; import java.net.InetAddress; import java.net.NetworkInterface; import java.net

Getting MAC address on a web page using a Java applet

牧云@^-^@ 提交于 2019-12-17 13:45:08
问题 I want to create an application where a web server can get the MAC Address of the clients logging in. The only possible way I could think of was to create a JAVA applet which contains java.net methods to find the mac address I am using javascript to call the applet methods, but the browser is not allowing those methods to execute. Below is the applet I have created. import java.applet.*; import java.awt.*; import java.net.InetAddress; import java.net.NetworkInterface; import java.net

Copy/Paste not working in a signed Applet

醉酒当歌 提交于 2019-12-17 12:36:54
问题 I've a signed applet (which verifies correctly with jarsigner ) that for some reason will not allow copy and paste from the system clipboard into a JTextField despite the documentation telling me that it is supposed to work for signed applets. Furthermore, I've other applets which are signed with the same keyfile that do let me copy and paste text. I have searched high and low on the internet and can't seem to find any clues. What is making me pull my hair out is that there seems to be no way

Embed a JavaFX application in a HTML webpage

帅比萌擦擦* 提交于 2019-12-17 10:35:32
问题 I'd like to embed one ore more JavaFX applications on a webpage. How do you do that? There are several bits and pieces on the Oracle website, but there's no complete example. There's the Deployment in the Browser tutorial, the Packaging Basics tutorial, etc. There's mentioning of Ant tasks and what not. So there were still a lot of questions after I read them. Like do I need Ant? Do I need to create an applet? etc All I'd like to see is a minimal and complete "Hello World" example in order to

Disabled Java warning appearance & affect on Java Web Start apps

余生颓废 提交于 2019-12-17 10:07:00
问题 Recently security vulnerabilities were discovered in the Java Plug-In 1 . As a protection for the end user, Java in most browsers was disabled promptly. What do the 'Java disabled' warnings look like? Does the blocking of applets also affect Java Web Start apps. (they are launched from a link in a web page) aimed at desktop use? Security vulnerability in the Oracle Java Plug-In. For more details see: The JRE 1.7 Vulnerability Q&A at SO. Oracle Security Alert for CVE-2013-0422 The Java™ SE

Applet method calling from Javascript

寵の児 提交于 2019-12-17 10:02:02
问题 I have an applet to upload some files from specific folder and delete them,but something is wrong when I call an applet function from my javascript code, when I call that function from init() it works fine. My applet code : public class Uploader extends Applet { String serverPath; String clientPath; private JSObject win; @Override public void init() { serverPath = getParameter("serverPath"); clientPath = getParameter("clientPath"); try { win = JSObject.getWindow(this); } catch (JSException e)