-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,36 @@ | ||
package me.ruslanys.vkmusic.util; | ||
|
||
import lombok.SneakyThrows; | ||
import lombok.extern.slf4j.Slf4j; | ||
import me.ruslanys.vkmusic.Application; | ||
|
||
import javax.imageio.ImageIO; | ||
import java.awt.*; | ||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.net.URL; | ||
|
||
/** | ||
* @author Ruslan Molchanov ([email protected]) | ||
*/ | ||
@Slf4j | ||
public class DesktopUtils { | ||
|
||
private static final Image ICON; | ||
private static final Desktop DESKTOP = Desktop.getDesktop(); | ||
|
||
static { | ||
Image image; | ||
try { | ||
URL resource = Application.class.getClassLoader().getResource("images/icon.png"); | ||
image = ImageIO.read(resource); | ||
} catch (IOException e) { | ||
log.error("Can not load an application icon", e); | ||
image = null; | ||
} | ||
ICON = image; | ||
} | ||
|
||
private DesktopUtils() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
@@ -27,4 +45,8 @@ public static void browse(URL url) { | |
browse(url.toURI()); | ||
} | ||
|
||
public static Image getIcon() { | ||
return ICON; | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.