Note that there are some explanatory texts on larger screens.

plurals
  1. POJava App developed in Eclipse don't work in web page
    primarykey
    data
    text
    <p>I have developed a small JApplet for a site. It's the first time I do such a thing, so it's probably a stupid error or misundestanding, but I can't find out what it is.</p> <p>Here is the first class called from the HTML:</p> <pre><code>public class MapGenerator extends JApplet { private static final long serialVersionUID = 1L; private int numero_immagini; private BufferedImage[] images; private int[] floors; private static final String N_IMMAGINI = "numero_immagini"; private static final String IMMAGINE = "immagine"; private static final String PIANO_IMMAGINE ="numero_piano"; public void init() { numero_immagini = Integer.parseInt(this.getParameter(N_IMMAGINI)); images = new BufferedImage[numero_immagini]; floors = new int[numero_immagini]; for(int i=0; i&lt; numero_immagini; i++) { try { URL url = new URL(this.getParameter(IMMAGINE+i)); images[i] = ImageIO.read(url); floors[i] = Integer.parseInt(this.getParameter(PIANO_IMMAGINE+i)); } catch (IOException ioe) {} } } public void start() { Editor ed = new Editor(this.getContentPane(), images, floors); this.setSize(400, 400); this.add(ed.getPanel()); Toolkit kit = this.getToolkit(); Dimension dim = kit.getScreenSize(); this.setBounds(dim.width/4, dim.height/4, dim.width/4, dim.height/4); this.setVisible(true); this.repaint(); } } </code></pre> <p>And here is the HTML:</p> <pre><code>&lt;applet code="MapGenerator.class" archive="MapGenerator.jar" width= 400 height = 200&gt; &lt;param name=numero_immagini value=1&gt; &lt;param name=immagine0 value="IMG_20111009_171138.jpg"&gt; &lt;param name=numero_piano0 value=0&gt; &lt;/applet&gt; </code></pre> <p>In Eclipse I haven't any problem at all, but when I tried with Chrome the page show only a gray box.</p> <p>Thank to all for help.</p> <p>EDIT</p> <p>The app cannot load images from the link that I pass.</p> <p>It trows, testing with a random link image</p> <pre><code>java.security.AccessControlException: access denied (java.net.SocketPermission www.hyros.net:80 connect,resolve) java.lang.NullPointerException </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload