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.

JOptionPane

Empfohlene Antworten

Veröffentlicht

Habe folgendes Problem,

hab eine kleine Sicherheitsabfrage für ein Programm!

Wenn ich den Dialog mit der Maus Bestätige klappt alles einwandfrei! Ich kann jedoch die beiden Buttons nicht mir Return auslösen, bzw. bei betätigen der Return Taste, löse ich immer nur das Standard Ereignis aus, in diesem Fall, das Yes! Wie frage ich in diesem Fall die Tastatur Ereignisse ab?? Irgendwie bekomme ich das Ereignes weder im Action noch im Key Listner mit!!

Jemand eine Idee??

thx

Gandalf


if (JOptionPane.showConfirmDialog(null,"Möchten sie die das Programm wirklich beenden?", "Sicherheitsabfrage",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
{
setVisible(false);
dispose();
System.exit(0);
}
else
{
//nothing
}
[/PHP]

Sers probiers mal mit getValue() viel spaß :-)

????

getValue???

wie und wo???

sorry, aber ich verstehe nicht so ganz wie ich das getValue anwenden soll!

Gruß

Gandalf

also du solltest erstmal JOptionPane op = new JOptionPane(...);

machen und dann kannst du mit op.getValue() nachschauen was eingegebn wurde (Ja/NEIN) proviers mal näheres in der java Docu unter JOptionPane!

AFAIK gibts die Möglichkeit Objecte zu übergeben und eins als Default auszuwählend. Wenn du dort einfach eigene JButtons übergibst, kannst du die auch mit nem eigenen KEyListener versehen.

hth

Hardi

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.