-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
57 lines (42 loc) · 1.57 KB
/
Copy pathMain.java
File metadata and controls
57 lines (42 loc) · 1.57 KB
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
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.net.MalformedURLException;
import java.net.URL;
public class Main {
public static void main(String[] args) {
MyAction myAction = new MyAction();
myAction.Act();
// JFrame jFrame = getFrame();
// jFrame.add(new MyComponents());
// EventHendl eventHandler = new EventHendl();
// eventHandler.Hundler();
// Action action = new Action();
// action.button();
// how many fonts
// String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
// for(String name : fonts){
// System.out.println(name);
// }
}
static JFrame getFrame(){ // create window
JFrame jFrame = new JFrame(){};
jFrame.setVisible(true);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension dimension = toolkit.getScreenSize();
jFrame.setBounds(dimension.width/2 -250,dimension.height/2 - 150, 500,300);//need half from width
jFrame.setTitle("Hello my Teddy ");
return jFrame;
// JFrame jFrame = new JFrame(){};
// jFrame.setVisible(true);
// jFrame.setDefaultCloseOperation(jFrame.EXIT_ON_CLOSE);
// jFrame.setSize(500,300);
//jFrame.setLocation(300,300);
}
}