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.

setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOS E); - ohne Wirkung !?

Empfohlene Antworten

Hi!

Ich möchste bei einem JFrame nach dem drücken des "x"-Buttons den benutzer fragen, ob der die Änderungen speichern will. Dazu habe ich setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); auf den entsprechenden JFrame gesetzt und die Benutzerfrage wird in der windowClosing-Methode angestoßen. Allerdings verschwindet der Frame sofort nach drücken von "x". Also scheint er die DefaultCloseOperation zu ignorieren, oder?

Hat jemand eine Idee, woran das liegen kann?

Gruß

backdraft

des funzt bei mir auch manchmal nicht aber manchmal schon, ka woran das liegt

ich hab des jetzt auch mittels windowEvent gelöst so kannste auch noch abfragen ob wirkliche geschlossen werden soll

mfg byte

Danke für die Antworten!

Hab das Problem einige Stufen höher in der Klassenhierarchie gefunden. Wie im richtigen Leben... man erbt nur die ungewollten Dinge... ;)

Gruß

backdraft

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.