-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisibleSort.java
More file actions
51 lines (38 loc) · 1.27 KB
/
VisibleSort.java
File metadata and controls
51 lines (38 loc) · 1.27 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
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
public class VisibleSort {
public static void main(String[] args){
openStartWindow();
}
public static void openStartWindow(){
JFrame startFrame = new JFrame("StartFrame");
startFrame.setVisible(true);
startFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//startFrame.getContentPane().add(, BorderLayout.CENTER);
startFrame.setLocationRelativeTo(null);
JPanel panel = new JPanel();
startFrame.add(panel);
Button startButton = new Button("Let's get start!");
startButton.addActionListener(new startAction());
panel.add(startButton);
startFrame.pack();
}
static class startAction implements ActionListener{
public void actionPerformed(ActionEvent e){
JFrame secondFrame = new JFrame("Set your sort.");
secondFrame.setVisible(true);
//secondFrame.setSize(200, 200);
JLabel secondJLabel = new JLabel("here is the place you set your sorting");
JPanel secondJPanel = new JPanel();
secondFrame.add(secondJPanel);
secondJPanel.add(secondJLabel);
secondFrame.pack();
}
}
}