hyungyun.Moon

add tab, gif, png, jpg

Java-Cesco/Detecting_fraud_clicks#13
This diff is collapsed. Click to expand it.
...@@ -12,6 +12,8 @@ public class Aggregation { ...@@ -12,6 +12,8 @@ public class Aggregation {
12 12
13 public static void main(String[] args) throws Exception { 13 public static void main(String[] args) throws Exception {
14 14
15 + new GUI();
16 +
15 //Create Session 17 //Create Session
16 SparkSession spark = SparkSession 18 SparkSession spark = SparkSession
17 .builder() 19 .builder()
......
1 +import javax.swing.*;
2 +import java.awt.*;
3 +
4 +public class GUI extends JFrame {
5 + JTabbedPane tab = new JTabbedPane();
6 + public GUI() {
7 + super("CESCO");
8 +
9 + tab.addTab("png", new PngPane());
10 + tab.addTab("gif",new GifPane());
11 + tab.addTab("jpg",new JpgPane());
12 +
13 + add(tab);
14 +
15 + setSize(800, 500); // 윈도우의 크기 가로x세로
16 + setVisible(true); // 창을 보여줄떄 true, 숨길때 false
17 + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // x 버튼을 눌렀을때 종료
18 + }
19 +
20 +// public static void main(String args[]) {
21 +// new GUI();
22 +// }
23 +}
24 +
25 +class PngPane extends JPanel {
26 + public PngPane() {
27 + super();
28 + ImageIcon image = new ImageIcon("data/model.png");
29 + JLabel label = new JLabel("", image, JLabel.CENTER);
30 + setLayout(new BorderLayout());
31 + add(label, BorderLayout.CENTER);
32 + }
33 +}
34 +
35 +class GifPane extends JPanel {
36 + public GifPane() {
37 + super();
38 + ImageIcon image = new ImageIcon("data/model.gif");
39 + JLabel label = new JLabel("", image, JLabel.CENTER);
40 + setLayout(new BorderLayout());
41 + add( label, BorderLayout.CENTER );
42 + }
43 +}
44 +
45 +class JpgPane extends JPanel {
46 + public JpgPane() {
47 + super();
48 + ImageIcon image = new ImageIcon("data/model.jpg");
49 + JLabel label = new JLabel("", image, JLabel.CENTER);
50 + setLayout(new BorderLayout());
51 + add( label, BorderLayout.CENTER );
52 + }
53 +}
...\ No newline at end of file ...\ No newline at end of file