applet

Drawing exotic fonts in a java applet

风格不统一 提交于 2019-12-24 07:11:39
问题 I'd like to draw symbols contained in exotic fonts such as Wingdings, Webdings (they are called dingbats : http://en.wikipedia.org/wiki/Dingbat) in a java applet. When using Graphics.drawString() I end up with the typical 'square symbol' for each character in the drawn string. I could not find any answer by googling and I guess it's not something common. In the past I've done it with C# WPF, failed to do it with SVG and HTML. Is it possible in java? EDIT: Solved. There was a subtlety. Even

Java Applet: Increase stack size

大憨熊 提交于 2019-12-24 07:06:03
问题 I was writing a small Java Applet in Eclipse to test a recursive algorithm. Since there are quite a lot recursive calls I needed to increase the stack size: -Xss10m This worked. Then I wanted to test the applet outside of Eclipse with appletviewer. So I wrote the needed html-file MyStuff.html: <html> <applet code="MyStuff.class" ARCHIVE=myjar.jar height=512 width=512> <PARAM name="java_arguments" value="-Xss10m"> </applet> </html> In order to start the applet I compile MyStuff.java: javac -cp

Security Exception in self signed sound recorder Applet

廉价感情. 提交于 2019-12-24 06:44:21
问题 I have created an applet for recording sound. It throws an exception when I try to open a dataline. TargetDataLine.open() java.security.AccessControlException: access denied (javax.sound.sampled.AudioPermission record) My applet is self signed, all other jar files are self signed. Previously I was using a different thread to start the TargetDataLine and close the line. Afterwords instead of creating another thread, I switched to Executorservice . It works fine with thread but throws above

In Java, AWT, repaint-method seems to be ignored in favor of start-method

ⅰ亾dé卋堺 提交于 2019-12-24 06:38:12
问题 I'm building an applet of a board game, and handling user input roughly looks like this: public void mousePressed(MouseEvent event) { int row = event.getX() / (getSize().width / 8) ; int column = event.getY() / (getSize().height / 8) ; if(possibleMove(column, row) { makeMove(column,row,whosTurn); repaint(); start(); } } After a human input, the computer chooses a move and calls repaint() and start() like this method does. But the screen seems to update only after the computer has made a move,

Check if a program is installed on a linux machine from a java applet

你说的曾经没有我的故事 提交于 2019-12-24 06:04:44
问题 Hi I need to be able to check if a certain software is installed on the clients computer and where, in order to launch it. I found the following three posts as to how to do so on Windows and Mac but I can't seem to figure it out for Linux as there is no registry. Does any one know how this can be done on Linux? Similar posts for Windows and Mac: Can a Java applet open a "select directory" and write to a filesystem via JavaScript interaction? read/write to Windows Registry using Java How can I

How do I rework my Java applet code to use a JPanel instead of a JFrame?

假装没事ソ 提交于 2019-12-24 05:45:45
问题 I'm a .net programmer just learning Java. I've been working on this issue for the past 2 weeks... Here is my code to show my security system webcams and update the images in a JFrame running in an applet: (I need to convert this code to work in a JPanel instead!) public class Streamer extends JApplet { String PATH = "C:/Security/CamCap/"; Integer UPDATE_INTERVAL = 100; String CAM1FILE = "current1.png"; String CAM2FILE = "current2.png"; String CAM3FILE = "current3.png"; String CAM4FILE =

Javascript library to reliably load Java Applets?

a 夏天 提交于 2019-12-24 03:34:28
问题 Flash users have the wonderful SwfObject JavaScript library that abstracts browser differences to reliably embed swfs into their web pages. Is there a JavaScript library like this for Java Applets? 回答1: Oracle itself comes with deployJava.js for this. Here's an example copied from the link: <script src="http://www.java.com/js/deployJava.js"></script> <script> var attributes = {codebase:'http://java.sun.com/products/plugin/1.5.0/demos/jfc/Java2D', code:'java2d.Java2DemoApplet.class', archive:

Export Applet Java with referenced libraries

梦想与她 提交于 2019-12-24 02:39:07
问题 I have coded an applet requiring 1 library jar file (prowser-0.2.0). I have tested it on eclipse (3.6) and it works but when i put it on my html website, i have got the following error. I have impoted pbrowser library from project properties => Java Build Path => Libraries => Add external Jar. This code works in runnable jar and as applet in Eclipse. Error from Java Console : "Exception in thread "thread applet-myapplet.class-4" java.lang.NoClassDefFoundError: Could not initialize class com

Managing upgrades to Java 7

陌路散爱 提交于 2019-12-24 02:28:26
问题 My team uses a lot of Java applications and applets (both internally created and from external sources). Since the release of Java 7, which we are using for some applications, we have found a number of problems with external applications and applets which do not support Java 7 (although I don't know why - however, having spoken to the tech support at the organisations that provide these applications, they indicate that their applications are not compatible with Java 7). Unfortunately, many of

I have a JApplet which has to display 3 Components. (2 JPanels and 1 Paint Method)

落花浮王杯 提交于 2019-12-24 01:19:07
问题 I have an assignment in which I have to allow a user to plot a graph using a quadratic equation. I managed to draw the skeleton of the graph, and now I am trying to display the "control panel" for the user to input the values. I have 4 files: graph.java panel.java panelB.java panelC.java My problem is when I run the code it is displaying only the panel.java even in the container where it should display the other two panels. panel.java import java.awt.Dimension; import java.awt.Graphics;