2024-06-12
This commit is contained in:
76
Writerside2/topics/Desktop.md
Normal file
76
Writerside2/topics/Desktop.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Desktop
|
||||
|
||||
* `Desktop.isDesktopSupported()`
|
||||
* `Desktop.getDesktop()`
|
||||
* `isSupported(Desktop.Action)`
|
||||
* `browse(URI)`
|
||||
* `mail(URI)`
|
||||
* `open(File)`
|
||||
* `edit(File)`
|
||||
* `print(File)`
|
||||
|
||||
## Desktop.Action
|
||||
* BROWSE
|
||||
* MAIL
|
||||
* OPEN
|
||||
* EDIT
|
||||
* PRINT
|
||||
|
||||
# GraphicsEnvironment
|
||||
|
||||
* `GraphicsEnvironment.getLocalGraphicsEnvironment()`
|
||||
* `GraphicsDevice getDefaultScreenDevice()`
|
||||
|
||||
# GraphicsDevice
|
||||
|
||||
* `isWindowTranslucencySupported()` : WindowTranslucency.TRANSLUCENT | PERPIXEL_TRANSLUCENT | PERPIXEL_TRANSPARENT
|
||||
|
||||
```java
|
||||
jFrame.setOpacity(0.5f);
|
||||
```
|
||||
|
||||
|
||||
## Splash Screen
|
||||
|
||||
* `SplashScreen.getSplashScreen()`
|
||||
* `Graphics2D createGraphics()`
|
||||
* `getBounds()`
|
||||
* `close()`
|
||||
|
||||
|
||||
```java
|
||||
final SplashScreen splashScreen = SplashScreen.getSplashScreen();
|
||||
Graphics2D graphics2D = splashScreen.createGraphics();
|
||||
// ...
|
||||
splashScreen.close();
|
||||
```
|
||||
|
||||
```
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: <class name>
|
||||
SplashScreen-Image: <image name>
|
||||
|
||||
```
|
||||
|
||||
|
||||
## System tray
|
||||
|
||||
* `SystemTray.isSupported()`
|
||||
* `SystemTray.getSystemTray()`
|
||||
* `add(TrayIcon)` / `remove(TrayIcon)`
|
||||
|
||||
|
||||
```java
|
||||
if(SystemTray.isSupported()){
|
||||
SystemTray systemTray = SystemTray.getSystemTray();
|
||||
systemTray.add(new TrayIcon(...));
|
||||
}
|
||||
```
|
||||
### TrayIcon
|
||||
|
||||
* `TrayIcon(Image,String,PopupMenu)`
|
||||
|
||||
* `setImage(Image)`
|
||||
* `setImageAutoSize(boolean)`
|
||||
* `setPopupMenu(PopupMenu)`
|
||||
* `setToolTip(String)`
|
||||
Reference in New Issue
Block a user