-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRestaurantPOS.java
More file actions
51 lines (43 loc) · 1.47 KB
/
RestaurantPOS.java
File metadata and controls
51 lines (43 loc) · 1.47 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
// Jason Jasper
// David Martin-Vaquero
// Jared Mclaren
// Regine Villongco
// Chemen Wong
import javax.swing.*;
import java.awt.*;
/**
* IS 380 Final Project - Restaurant Point of Sale program.
* @author Jason Jasper, David Martin-Vaquero, Jared Mclaren, Regine Villongco, Chemen Wong
* @version 0.1.0
*
* This is the main class. It generates 9 Table objects in an array. It also gives application wide
* access to the Table method isAvailable(tableNum)
*/
public class RestaurantPOS {
public static Table[] tableArray;
// Main method for creating the restaurant point of sale GUI.
public static void main(String[] args) {
//Instantiate 9 Table objects.
tableArray = new Table[9];
for (int i=0; i<9; i++) {
// Create table array elements.
tableArray[i] = new Table(i+1);
}
// Create main window and set its look and feel (Windows style).
MainMenu mainWindow = new MainMenu();
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
catch (Exception e) {
JOptionPane.showMessageDialog(null, "Error setting the Look and Feel!");
}
mainWindow.setVisible(true);
}
/**
Method for checking if tables are in use.
@return Boolean value to determine table availability.
*/
public static boolean isTableAvailable(int tableNum) {
return tableArray[tableNum-1].isAvailable();
}
}