/
Atom.java
66 lines (48 loc) · 1.67 KB
/
Atom.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package me.atom.windowsj;
import java.awt.*;
import java.io.*;
import javax.swing.*;
/**
* Atom.java created by Guillaume Cendre (aka chlkbumper)
*
* Atom's main class. Checks either the required directory (AppData/Atom) exists
* or not. If it doesn't, it creates it. It also initializes the user interface.
*/
public class Atom {
static DialogWindow window;
static int screenHeight;
static int screenWidth;
public static void main(String[] args) throws IOException, FontFormatException, InterruptedException {
String appDataPath = System.getenv("APPDATA");
File audioDirectory = new File(appDataPath + "\\Atom");
if (!audioDirectory.exists()) {
try {
if(audioDirectory.mkdir()) {
} else {
}
} catch (Exception e) {
e.printStackTrace();
}
}
startAtom();
}
public static void startAtom() throws IOException, FontFormatException, InterruptedException {
String appDataPath = System.getenv("APPDATA");
System.out.println(appDataPath);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
Image icon = Toolkit.getDefaultToolkit().getImage("images/iconsmall.png");
window = new DialogWindow();
window.setIconImage(icon);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
screenWidth = (int)screenSize.getWidth();
screenHeight = (int)screenSize.getHeight();
int x = (int) (screenWidth - (screenWidth/3.5));
window.setLocation(x, 10);
window.setSize(new Dimension((int) (screenWidth/3.5)-10,(int) (screenHeight-45)));
window.setAlwaysOnTop(true);
}
}