Bonjour a tous,
j'ai une petit problème gênant.
J'ai un code qui fonctionne sans problème sous eclipse, mais qui ne fonctionne pas une fois exporté en jar.
Le code utilise la lib http://djproject.sourceforge.net/ns/index.html
voici le code (c'est un code d'exemple de fonctionnement de la lib)
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 package ihm; /* * Christopher Deckers (chrriis@nextencia.net) * http://www.nextencia.net * * See the file "readme.txt" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.BorderFactory; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; import chrriis.common.UIUtils; import chrriis.dj.nativeswing.swtimpl.NativeInterface; import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; /** * @author Christopher Deckers */ public class Test extends JPanel { public Test() { super(new BorderLayout()); JPanel webBrowserPanel = new JPanel(new BorderLayout()); webBrowserPanel.setBorder(BorderFactory .createTitledBorder("Native Web Browser component")); final JWebBrowser webBrowser = new JWebBrowser(); webBrowser.navigate("http://www.google.com"); webBrowserPanel.add(webBrowser, BorderLayout.CENTER); add(webBrowserPanel, BorderLayout.CENTER); // Create an additional bar allowing to show/hide the menu bar of the // web browser. JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 4, 4)); JCheckBox menuBarCheckBox = new JCheckBox("Menu Bar", webBrowser.isMenuBarVisible()); menuBarCheckBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { webBrowser.setMenuBarVisible(e.getStateChange() == ItemEvent.SELECTED); } }); buttonPanel.add(menuBarCheckBox); add(buttonPanel, BorderLayout.SOUTH); } /* Standard main method to try that test as a standalone application. */ public static void main(String[] args) { UIUtils.setPreferredLookAndFeel(); NativeInterface.open(); SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame("DJ Native Swing Test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(new Test(), BorderLayout.CENTER); frame.setSize(800, 600); frame.setLocationByPlatform(true); frame.setVisible(true); } }); NativeInterface.runEventPump(); } }
Cette lib utilise SWT, dans eclipse j'ai bien sur ajouter au build path le jar de SWT et le jar de la lib.
Donc savez vous pourquoi cela ne fonctionne pas ?
Je vous remercie d'avance pour votre aide
Partager