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.

Schließen eines Frames abbrechen

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich haben bei meinem Swing Proggi einen JFrame als Hauptfenster. Für diesen Frame habe ich einen Window Adapter installiert, der auf windowClosing reagiert.

in diesem windowClosing gebe ich eine MessageBox aus, in der der Benutzer darauf hingewiesen wird, dass noch Daten nicht gespeichert sind. Als Antwortmöglichkeiten gibt es "Ja" (speichern), "Nein" (nicht speichern) und "Abbrechen" (zurück zum Programm).

Das "Abbrechen" soll also das Beenden unterbrechen. Bis jetzt hab ich an dieser Stelle ein setVisible(true); stehen, ansonsten mache ich dort nichts (kein dispose, exit(0)...)

Dummerweise ist der Frame danach trotzdem weg!?! Wenn ich mir den Taskmanager anschaue, dann schwirrt die Applikation dort aber trotzdem noch in der Gegend rum (ist wohl nur nicht sichbar???)

Hat jemand einen Tipp, was ich da falsch mache??

Versuche mal folgendes bei der Initialisierung des Frames:

frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

Gruß

Snowghost

Jupps, das klappt :D . Danke schön!

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.