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.

Hintergrundcomponente für JDesktopPane

Empfohlene Antworten

Veröffentlicht

So langsam werd ich echt blöd hier. Ich wollte einem JDesktopPane als Hintergrund eine bedienbare Karte(eine komplette Komponente mit MouseListenern etc...) geben. Damit die JDesktopPanes über dieser liegen habe ich dann einfach die add(Component comp) überschrieben, so dass die Componente dort immer an oberster Stelle eingefügt wird (es sei denn es handelt sich um die Karte - die ist immer an niedrigster Stelle).

Soweit funktioniert das auch ganz gut, allerdings in dem Moment wo ich ein JInternalFrame minimiere wird das entsprechende JDesktopIcon erstmal nicht angezeigt, solang bis ich an die Stelle klicke wo es sein sollte (dann tauchts auf). Hab auch schon versucht das teil repainten zu lassen - negativ.

Wie würdet ihr das angehen, wenn ihr eine Komponente als Hintergrund eines JDesktopPanes setzen wollt?

Source-Code:

		desktop = new JDesktopPane(){

			@Override

			public Component add(Component comp) {

				if(comp == viewer){

					return super.add(comp,getComponentCount());

				}else{

					return super.add(comp,0);

				}

			}


		};

		viewer = new GeoViewPanel();

		desktop.add(viewer,desktop.getComponentCount());

  • Autor

Hat sich erledigt.

Die moveToBack(Component c)- und moveToBack(Component c)-Methoden des JDesktopPanes hatten offenbar ihr freude daran mir meine paint-Reihenfolge zu versauen indem sie die JDesktopIcons hinter die Map schieben.

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.