applet

Java Applet work only on my computer?

狂风中的少年 提交于 2019-12-13 05:13:51
问题 I'm developing a Java applet that show a message box when you visit the site. This is my Java code: import java.applet.Applet; import javax.swing.JOptionPane; public class JavaRun extends Applet { private static final long serialVersionUID = 1L; public void init() { JOptionPane.showMessageDialog(null, "hello world!"); } } This is the html: <applet width='100' height='100' code='JavaRun' archive='data.jar'> </applet> On my computer (that have the java SDK) it's work, but when I'm using it on

Java sprite falling?

风流意气都作罢 提交于 2019-12-13 05:10:25
问题 Sorry, I did not know how to word the title well. But I am making a Java game where you have a paddle at the bottom of your screen and you can move it left and right in order to avoid falling asteroids. I have the paddle working, but I do not know how to make a falling asteroid. The asteroid will just be a rectangle for now. I also would like to be able to adjust the speed and how many asteroids fall. Here is my code: public class Main extends Applet implements KeyListener, MouseListener {

Detect Display Type (Projector) from within the browser

∥☆過路亽.° 提交于 2019-12-13 04:42:07
问题 It goes like this, we need to detect if the display is a Projector (or if the system is connected to a Projetor). the catch is this should be done from within the browser. so is it possible to do so by using an Java Applet Flash ActiveX (this does constrains to a single browser, so not an option) searching so far only reaveals display resolution. expecting if there is something still out there. . . Edit: accecpted answer is for Java Applet approach. hope there may be an easier way through

How am I supposed to draw an image from my Java Applet?

℡╲_俬逩灬. 提交于 2019-12-13 04:22:05
问题 I am not sure how to fully express this but, I have probably gone through 10 pages of Google links on this topic and not one of them has helped me solve my issue. I thought it would be simple enough, I was just trying to add an image to the paint function of my java applet, like any other shape, but this has turned out to be a nightmare for me. The problem is that every time I try to run the drawImage function it keeps saying Access Denied ("java.io.FilePermission" "Image.jpg" "read") . Yet,

Java Applet with form based authentication works on IE fails on Chrome

与世无争的帅哥 提交于 2019-12-13 04:02:09
问题 The setup is as follows: Web Application (EAR file) packaging a Java Applet component and using form based authentication is deployed to WebSphere 8. Workstation is using Java 1.7.0_45. When connecting from IE11 after authenticating the login form, WebSphere returns an Html page containing an Applet tag. The Applet Jar file is then downloaded correctly from WebSphere and the Applet is launched. When using Chrome however the download of the Applet Jar file fails as if the authentication token

Why is the thread priority set to maximum in a loop in this java applet tutorial code?

旧时模样 提交于 2019-12-13 04:00:00
问题 I'm trying to learn some basic java programming for games. I'm following this tutorial here. Their skeleton code for the run method in an applet: public void run () { // lower ThreadPriority Thread.currentThread().setPriority(Thread.MIN_PRIORITY); // run a long while (true) this means in our case "always" while (true) { // repaint the applet repaint(); try { // Stop thread for 20 milliseconds Thread.sleep (20); } catch (InterruptedException ex) { // do nothing } // set ThreadPriority to

MySQL ExceptionInInitializerError Java JDBC on Startup

久未见 提交于 2019-12-13 03:40:36
问题 I am making a simple applet that uses an SQL Database. When I use this applet locally on Netbeans it runs fine without a problem, yet when I deploy it to the Web I am getting a weird error. I am using Java 1.6 locally, and the server I deploy on is running Java 1.6 I am using J2BC 5.1.22. This is the error I get: java.lang.ExceptionInInitializerError at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:315) at java.sql.DriverManager.getConnection(Unknown Source) at java

Can't display images from localhost

点点圈 提交于 2019-12-13 03:39:58
问题 I dont understand why in my webAPP When I try to load an Icon by doing this for exemple : ImageIcon rtfIcon = new ImageIcon("http://localhost:8080/app/images/rtf.gif"); the rtfIcon.getImageLoadStatus() returns an ERRORED value . But in my web browser it displays properly http://localhost:8080/app/images/rtf.gif . I dont get it . I use apache tomcat . Is there any option configuration to do or it's simple coding mistake ? thanks in advance . 回答1: ImageIcon rtfIcon = new ImageIcon("http:/

Signed Java Applet gives AccessControlException when calling from JavaScript

不羁的心 提交于 2019-12-13 03:37:50
问题 First of all I'm aware that my question is same as in here. But that question did not helped me. I have self signed applet. jarsigner -verify sJSApplet.jar jar verified. Warning: This jar contains entries whose signer certificate will expire within six months. Applet's purpose is to open MS Word document from LAN machine. So far I've tried opening using Desktop.open() and Runtime.exec() . With AccessController.doPrivileged and without. I always get java.security.AccessControlException: access

WebScanner Java Applet App Not working in chrome , NPAPI deprecated any solutions?

半城伤御伤魂 提交于 2019-12-13 03:06:52
问题 Java Applet is not working in chrome, As NP-API is been depreciated is there any alternative solution, to load applet in browser and scanner is invoked to scan the file. Advance Thanks, any help is appreciated. Scanner Applet application 回答1: What's the chrome version?? Copy and paste "chrome://flags/#enable-npapi" into your Chrome browser and hit enter Click the Enable link. Quit your Chrome browser, then re-open it. 回答2: There's no way to run a Java applet within Chrome without NPAPI