Bonjour a tous, voilà je suis confronté a un serieux probleme qui requiere vos compétence de gosu en programmation java applet, je suis en train d'essaier de developper une ihm en java exploitable sur le web (donc via les applets), seul souci, soit IE soit Firefox n'arrive a afficher l'applet
alors tout d'abord le code du .java :
L'erreur obtenue :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74 /* * myrecorder.java * * Created on 16 août 2006, 09:26 */ package myrecorder; /** * * @author MT */ public class myrecorder extends javax.swing.JApplet { /** Initializes the applet myrecorder */ public myrecorder(){}; public void init() { try { //java.awt.EventQueue.invokeAndWait(new Runnable() { // public void run() { initComponents(); // } // }); } catch (Exception ex) { ex.printStackTrace(); } } public void start(){} public void stop (){} public void destroy(){} public String getAppletInfo() { return "Applet Information"; } /**Get parameter info*/ public String[][] getParameterInfo() { return null; } /** This method is called from within the init() method to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { jButton1 = new javax.swing.JButton(); jButton1.setText("jButton1"); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(94, 94, 94) .add(jButton1) .addContainerGap(231, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(83, 83, 83) .add(jButton1) .addContainerGap(194, Short.MAX_VALUE)) ); }// </editor-fold> // Variables declaration - do not modify private javax.swing.JButton jButton1; // End of variables declaration }
Et enfin le code html (générer par NetBeans) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
Je précise que qd je fais "Execute File" sur mon fichier .java, l'applet se lance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 <HTML> <HEAD> <TITLE>Applet HTML Page</TITLE> </HEAD> <BODY> <!-- *** GENERATED applet HTML launcher - DO NOT EDIT IN 'BUILD' FOLDER *** If you need to modify this HTML launcher file (e.g., to add applet parameters), copy it to where your applet class is found in the SRC folder. If you do this, the IDE will use it when you run or debug the applet. Tip: To exclude an HTML launcher from the JAR file, use exclusion filters in the Packaging page in the Project Properties dialog. For more information see the online help. --> <H3><HR WIDTH="100%">Applet HTML Page<HR WIDTH="100%"></H3> <P> <APPLET codebase="classes" code="myrecorder/myrecorder.class"width=350 height=200></APPLET> </P> <HR WIDTH="100%"><FONT SIZE=-1><I>Generated by NetBeans IDE</I></FONT> </BODY> </HTML>
Il serai bien, si besoin d'ajouter/modifier des librairies de m'indiquer le chemin ou le faire.
Merci Beaucoup de votre aide
Partager