Skip to content

Commit 4870239

Browse files
committed
test
1 parent 4e3313a commit 4870239

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

src/Main.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import java.awt.*;
12
import java.io.IOException;
23
import java.net.URISyntaxException;
34

45
public class Main {
5-
public static void main(String[] args) throws IOException, URISyntaxException {
6+
public static void main(String[] args) throws IOException, URISyntaxException, AWTException {
67

78
}
89
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package swing.awt;
2+
3+
import javax.swing.*;
4+
import java.awt.*;
5+
import java.io.IOException;
6+
import java.net.URISyntaxException;
7+
8+
public class SystemTrayLesson {
9+
public static void main(String[] args) throws IOException, URISyntaxException, AWTException {
10+
if(SystemTray.isSupported()) {
11+
SystemTray tray = SystemTray.getSystemTray();
12+
Image image = new ImageIcon("/home/max/IdeaProjects/JavaLessons/icon.jpg", "descr").getImage();
13+
PopupMenu menu = new PopupMenu();
14+
menu.add(new MenuItem("one"));
15+
menu.add(new MenuItem("two"));
16+
tray.add(new TrayIcon(image, "description", menu));
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)