applet

How to code the projectile of a ball of different force and angle in Java Swing?

北战南征 提交于 2019-12-28 03:05:14
问题 I have written the following function for projectile motion of different force and angle, but it doesn't work properly. Where have I gone wrong? I want something like the Angry Birds game. Code: public void shootBall(int timeCounter){ int gravity = 4; double time = timeCounter/40.0; int velocity = force_value; double radians = currentangle*Math.PI/180; ball.setX((int)((ball.getX()+10)*Math.cos(radians) + velocity*Math.cos(radians)*time)); ball.setY((int)((ball.getY()+10)*Math.sin(radians) +

Calling a DLL from an Applet via JNI

China☆狼群 提交于 2019-12-28 02:53:27
问题 I have a "proof of concept" piece of work that crosses over into some unfamiliar territory. I'm tasked with connecting an EFTPOS machine to an application running as an applet in a browser on our intranet. I've ignored the EFTPOS dll for the moment and created a simple JNI decorated DLL in my language of choice (Delphi) that just logs a string to a text file in c:\ and I can call it successfully from a local Java application. However, when I create an applet to do the same thing, compile it

How do you debug Java Applets?

淺唱寂寞╮ 提交于 2019-12-28 01:49:12
问题 Currently, the only information I have is a one-line error message in the browser's status-bar. Do you know how I could get a stack-trace for example ? 回答1: This article is a bit old but is still relevant (including a section entitled "How to Debug Applets in Java Plug-in"). Edit: perhaps a better way to get stacktraces is to use the Java plugin console. If you hit "t" in that window, you'll see the following: Prints out all the existing thread groups. The first group shown is Group main. ac

Web hosting services that allow Java applets [closed]

笑着哭i 提交于 2019-12-26 01:27:05
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I have created a website to host a portfolio of my programming work. Some of my projects are games in the form of Java applets. Surprisingly, it sounds like a lot of the major web hosts do not support Java applets. I don't understand how or why this could be, since I thought Java applets were downloaded by the

java applet java.security.AccessControlException: access denied java.net.SocketPermission

妖精的绣舞 提交于 2019-12-25 18:20:03
问题 I friend of mine gave me a script to run minecraft skins on my site but i keep getting this error and i dont have any clue how to go about this... =( http://allcitybuilder.com/new/example.html java.security.AccessControlException: access denied (java.net.SocketPermission www.minecraft.net:80 connect,resolve) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission

Why do I get java.lang.reflect.InvocationTargetException in browser but not in eclipse applet viewer?

做~自己de王妃 提交于 2019-12-25 16:08:15
问题 Just like the title says: Why do I get java.lang.reflect.InvocationTargetException in browser but not in eclipse applet viewer? When I run my applet (yes, i know applets are outdated) in the browser using html to load it, i get the java.lang.reflect.InvocationTargetException error. I read that this happens when the HTML is trying to load something that is not an applet, but it works when I run it as an applet in eclipse (brings up eclipse java applet viewer and works perfect...that is what

Applet running in Chrome

女生的网名这么多〃 提交于 2019-12-25 12:44:37
问题 I need to run an applet in the browser because the issue Send pdf jasper straight to the printer in web app The applet is working but I can not run it in Chrome the message plugin not supported. Versão 46.0.2490.86 m <!DOCTYPE html> <html> <head> <title>Serviço de Impressão</title> </head> <body> <center> <object data="Imprimir.jar" type="application/x-java-applet" width="400px" height="740px" > </object> </center> </body> </html> 来源: https://stackoverflow.com/questions/33735509/applet

How to add different actionlisteners to the same object

假装没事ソ 提交于 2019-12-25 11:55:45
问题 How do I add different actionlisteners to the p1 objects. I want the program to be able to set the textbar to the appropriate number when pressed with the appropriate button. Since they are not different variables I cannot simply use the code below(in my actionPerformed function), if (e.getSource() == button1){ txtField.setText("1"); } import java.awt.*; import java.applet.*; import java.awt.event.*; public class Telephone extends Applet implements ActionListener { TextField txtField; public

How to launch a Java Web start application with dynamic parameters

夙愿已清 提交于 2019-12-25 09:06:56
问题 I'm trying to migrate a Java applet to a Java web start application. The applet was activated from a JavaScript with several parameters, some are not hard-coded ( sessionId , tempFilePath ): deployJava.runApplet(attributes, parameters); In order to migrate the applet I'm using a simple JNLP file with applet-desc tag. And from the JavaScript I call: deployJava.launchWebStartApplication('$jnlp_path'); I just can't understand how to pass to the web start application the parameters that were

How to use apache fop with extensions (f.e. barcode4j) in java applet

时光总嘲笑我的痴心妄想 提交于 2019-12-25 08:47:51
问题 I want to have a barcode (Code128) generated during the xsl fop translation. As it is said in the apache fop documentation (and barcode4j docs), if you want to use extension, put it on the classpath. This works fine for a desktop app and an applet running from the eclipse. But how to run it from a browser? As a proof of concept, I extracted everything to so called 'fat-jar' - one jar, everything repacked from the eclipse as "Export to runnable jar" with "Extract required libs into generated