Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Editierbare ComboBox beim JOptionPane ???

Empfohlene Antworten

Mit "JOptionPane.showInputDialog(...);" bekomme ich ein JOptionPane mit einer JComboBox (wenn ich dafür im Konstruktor ein Array zur Verfügung stelle) und zwei JButtons (Cancel, OK).

Wie bekomme ich es hin, dass diese ComboBox editierbar wird ?

Für eine einfache JComboBox weiß ich das auch dass das so geht.

Darum gehts aber nicht.

Denn nur, wenn du mir jetzt noch erzählst, wie ich die im JOptionPane eingebettete JComboBox anspreche, wäre ich glücklich.

Hi,

du könntest dir alle componenten der JOptionPane mit getComponents() geben lassen.

Das Component[] durchläufst du dann und schaust, of die aktuelle Componente instanceof JComboBox ist und castest die Componente dann zu JComboBox.

Gruß Jaraz

Du meinst so:

JOptionPane jop = new JOptionPane(Vectorinhalt);

Component[] c = jop.getComponents();

for (int i =0; i < c.length; i++)

{

if (((Component)c) instanceof JComboBox)

{

JComboBox combo =(JComboBox)c;

combo.setEditable(true);

}

}

Hatte ich schon versucht. Es werden lediglich 2 JPanel gefunden, die wiederum Componenten enthalten usw. Im Debugger habe ich aber keine JComboBox ausfindig machen können.

Hi,

dann weiss ich auch nicht weiter.

Musste dir notfalls was eigenes basteln.

Gruß Jaraz

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.