Bonjour,

j'ai commencé un projet gtkmm et je voudrais basculer en Java car je préfère ce langage.
j'ai suivi les conseils d'installation et de configuration de zetcode.com qui présente un tutoriel sur le sujet.
Quand j'essaye de mettre un menu dans la fenêtre, je rencontre le message d'erreur suivant:
`menu_proxy_module_load': /home/jaaf/JavaGTK/jdk1.7.0/jre/bin/java: undefined symbol: menu_proxy_module_load
DANGER: Gtk-WARNING, Failed to load type module: (null)

Exception in thread "main" org.gnome.glib.FatalError: Gtk-WARNING
Failed to load type module: (null)

at org.gnome.gtk.GtkMenuBar.gtk_menu_bar_new(Native Method)
at org.gnome.gtk.GtkMenuBar.createMenuBar(GtkMenuBar.java:55)
at org.gnome.gtk.MenuBar.<init>(MenuBar.java:65)
at com.zoraldia.ApplicationWindow.initUI(ApplicationWindow.java:42)
at com.zoraldia.ApplicationWindow.<init>(ApplicationWindow.java:20)
at com.zoraldia.ApplicationWindow.main(ApplicationWindow.java:64)
Si je clique sur (Native Method) ça me dit:
the source attachment doesn't content the source for the file GtkMenuBar.class
Et effectivement /usr/local/share/java/gtk-4.1.jar contient bien MenuBar.class mais pas GtkMenuBar.class. Que faire?
Voici le code:
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
package com.zoraldia;
import org.gnome.gdk.Event;
import org.gnome.gtk.Gtk;
import org.gnome.gtk.Menu;
 
 
import org.gnome.gtk.MenuBar;
import org.gnome.gtk.MenuItem;
import org.gnome.gtk.VBox;
import org.gnome.gtk.Widget;
import org.gnome.gtk.Window;
 
public class ApplicationWindow extends Window {
 
 
 
	public ApplicationWindow() {
 
		setTitle("Score editor");
		initUI();
		setTitle("Easy Score Editor");
		setBorderWidth(5);
		setDefaultSize(1920, 1200);
 
 
 
		showAll();
	}
 
 
    private void initUI() {
 
        connect(new Window.DeleteEvent() {
            public boolean onDeleteEvent(Widget source, Event event) {
                Gtk.mainQuit();
                return false;
            }
        });
 
        VBox vbox = new VBox(false, 0);
 
        MenuBar menuBar = new MenuBar();
        MenuItem fileItem = new MenuItem("File");
        menuBar.append(fileItem);
 
        Menu quitMenu = new Menu();
        MenuItem quitItem = new MenuItem("Quit");
 
        quitItem.connect(new MenuItem.Activate() {
 
            public void onActivate(MenuItem menuItem) {
                Gtk.mainQuit();
            }
        });
 
        quitMenu.append(quitItem);
        fileItem.setSubmenu(quitMenu);
 
        vbox.packStart(menuBar, false, false, 3);
        add(vbox);
    }
	public static void main(String[] args) {
		Gtk.init(args);
		new ApplicationWindow();
		Gtk.main();
	}
}