jeudi 5 mars 2015

GTK ComboBoxText raise error



I'm trying to use an ComboBoxText created with Glade but it's raise the following error.



public static void main(String[] args) throws FileNotFoundException, ParseException {
Gtk.init(null);
Builder b = new Builder();
b.addFromFile("resources/TestComboBox.glade");
Window window = (Window) b.getObject("window");
ComboBoxText comboBoxText = (ComboBoxText) b.getObject("combo");
window.showAll();
Gtk.main();
}


Raise the following error



DANGER: (null)-CRITICAL, Constructor methodID not found
Exception in thread "main" java.lang.NoSuchMethodError: <init>
at org.freedesktop.bindings.Plumbing.createPointer(Native Method)


My glade file



<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkWindow" id="window">
<property name="width_request">100</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBoxText" id="combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</interface>


I can create my comboboxtext manualy by replacing line 6 and it's works



Box box = (Box) b.getObject("box");
ComboBoxText combo = new ComboBoxText();
combo.appendText("SYD");
box.add(combo);


Do you have any idea ?




Aucun commentaire:

Enregistrer un commentaire