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.

JComboBox / 3 gleichzeitig ändern

Empfohlene Antworten

Veröffentlicht

Hi @all,

ich möchte durch mein Programm drei JComboBoxes gleichzeitig ändern, aber irgendwie ändert er immer nur die erste? Weiss jemand, wie das gehen könnte?

Grüsse,

ET

??????????????????????????

Ein bisschen mehr Informationen (oder Code) wäre mit Sicherheit nicht schädlich....

Also, ich habe drei JComboBoxes. Die kann ich natürlich durch anclicken und auswählen ändern. Jetzt möchte ich aber auf Buttonclick alle drei ComboBoxes ändern. So z.B. :

comboBox1.setSelectedItem(item1);

comboBox2.setSelectedItem(item2);

comboBox3.setSelectedItem(item3);

Das Problem ist nun, dass er immer nur die erste Box ändert. Mir ist schon klar, dass schon durch ausführen der 1. Zeile wieder actionPerformed(ActionEvent event) aufgerufen wird und hab auch versucht, die 2. und 3. Zeile dann an entsprechender Stelle auszuführen, geht aber nicht.

Hast du auf deinen ComboBoxes vielleicht ItemListener registriert, die die Auswahl evtl. wieder aufheben?

Schicke doch ein bisschen mehr Code - so kann dir glaube ich niemand wirklich weiter helfen.

Snowghost

Danke, aber hat sich schon erledigt. :)

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.