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.

Größe der maximal Nutzbaren Screen Size

Empfohlene Antworten

Veröffentlicht

Hallo,

mit folgenden Code erhalte ich da die gesamte Größe des Screens:


Toolkit.getDefaultToolkit().getScreenSize();

Ich brauche aber die maximal Nutzare Screen Size, den aktuell mit dem oberen Code liegt mein JFrame über der Taskleiste. Im .NET gibts dafür:

Screen.PrimaryScreen.GetWorkingArea();

Weiß jemand wie ich das in Java lösen könnte?

lg

Gateway

  • Autor

Laut einem Forum Post soll es so gehn:


com.ms.wfc.ui.Screen screen;

com.ms.wfc.ui.Rectangle workingArea;

com.ms.wfc.ui.Point point;


point = new Point(1,1); // Pick an arbitrary location

screen = com.ms.wfc.ui.Screen.getPrimary(); // Get the Primary screen 

workingArea = screen.getWorkingArea(point); // Get working area of that screen

int workW = workingArea.width;

int workH = workingArea.height;

Dummerweise hatte der Autor nicht dazugeschrieben welche jar ich einbinden muss beziehungsweise wo ich diese herbekomme. Aktuell bemengelt mir eclipse den namespace com.ms.

Es existiert zwar com aber dieser hat keinen unter im definierten namespace namens ms.

lg

Gateway

Für awt/swing sollte das funktionieren:


GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();

		Rectangle r = ge.getMaximumWindowBounds();	

		System.out.println(r.height);

		System.out.println(r.width);

Bearbeitet von michaTT

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.