forked from ndraiman/SQL-JDBC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tester.java
41 lines (31 loc) · 1.36 KB
/
Tester.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
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Tester {
/************ NOTES ***********
*
* fixed method name from CheapastFlifht to CheapestFlight
*
*******************************/
public static void main(String[] args) {
//Credits Dialog
JOptionPane.showConfirmDialog(null, "Created by Netanel Draiman \nTester v1.0", "FlightDatabase Tester",
JOptionPane.CLOSED_OPTION, JOptionPane.INFORMATION_MESSAGE);
JFrame frame = new JFrame("FlightsDatabase");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 500);
//Open Frame in middle of screen
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation(dim.width/2-frame.getSize().width/2, dim.height/2-frame.getSize().height/2);
//Output Redirection - Yes = Frame, No = Console.
int option = JOptionPane.showConfirmDialog(null, "Redirect Output to Frame? \n (No = Output to Console)",
"Output Redirect", JOptionPane.YES_NO_OPTION);
/*******************************************************************/
/*** Put your SQL Username & Password into the Constructor below ***/
/*******************************************************************/
FlightsPanel fp = new FlightsPanel("system", "password", option);
frame.add(fp);
frame.setVisible(true);
}
}