-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDangerPointMap.java
More file actions
40 lines (30 loc) · 1.18 KB
/
DangerPointMap.java
File metadata and controls
40 lines (30 loc) · 1.18 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
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.net.URI;
public class DangerPointMap {
public void InputAndSwing() {
// GUI 띄우기
SwingUtilities.invokeLater(() -> showRiskWindow());
}
public void showRiskWindow() {
JFrame frame = new JFrame("산불 위험도 알림");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 300); // 조금 더 여유 있는 창 크기
JButton button = new JButton("실시간 산불위험지도 열기");
// 버튼 폰트 크기 키우기
button.setFont(new Font("맑은 고딕", Font.BOLD, 20)); // 글꼴과 크기 설정
button.setPreferredSize(new Dimension(300, 80)); // 버튼 크기 설정
// 가운데 배치
frame.setLayout(new GridBagLayout());
frame.add(button);
button.addActionListener((ActionEvent e) -> {
try {
Desktop.getDesktop().browse(new URI("http://forestfire.nifos.go.kr/menu.action?menuNum=1"));
} catch (Exception ex) {
ex.printStackTrace();
}
});
frame.setVisible(true);
}
}