Veröffentlicht 4. Februar 200322 j Hi, kann mir irgendjemand sagen, wie ich mit einer JComboBox umzugehen habe. Mein Problem ist, dass sich die Box nie aufklappen lässt. Bei dem Beispielcode bekomme ich zwar eine ComboBox, diese enthält allerdings nur eine eine String-Representation meines String[] test und lässt sich halt nicht aufklappen. Kann mir jemand weiterhelfen? JComboBox combo = new JComboBox(); String[] test = { "Hallodriho", "Und noch einer" }; combo.addItem(test); gruss tomac
4. Februar 200322 j Probier mal JComboBox combo = new JComboBox(); String[] test = { "Hallodriho", "Und noch einer" }; for (int i = 0; i < test.length; i++){ combo.addItem(test[i]); } [/PHP]
4. Februar 200322 j Oder: [B]String[] test = { "Hallodriho", "Und noch einer" }; JComboBox combo = new JComboBox(test);[/B] Gruß Jaraz :StefanE
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.