Contol Windwo Update. Velocity Change implemented. FONT and some other Var and method needs to be implemented in the GUI class not in Menu Window

Database Update
This commit is contained in:
Noah
2021-12-01 10:55:23 +01:00
parent 0d5aca00ba
commit 1b05840e5b
5 changed files with 156 additions and 6 deletions
+42
View File
@@ -121,4 +121,46 @@ public class DataBase {
}
public Boolean[][] getGrid(String gridName){
connect();
ResultSet resultSet = resultSetSQL("select * from gameInfo where name = '"+gridName+"'");
try {
resultSet.next();
int id = resultSet.getInt("id");
String name = resultSet.getString("name");
int width = resultSet.getInt("width");
int height = resultSet.getInt("height");
int gen = resultSet.getInt("generation");
boolean[][] cells = new boolean[width][height];
ResultSet data = resultSetSQL("select * from gameData where id ="+id);
data.next();
System.out.println("");
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
cells[x][y] = false;
}
}
} catch (SQLException e) {
e.printStackTrace();
}
disconnect();
return null;
}
}
+2 -2
View File
@@ -300,7 +300,7 @@ public class MenuWindow {
private void initModeBox(){
modeBox = new JComboBox<String>();
modeBox.setBounds(180, 257, 100, 20);
modeBox.setBounds(180, 257, 200, 20);
addComboBoxEntry(modeBox, "Randomized");
addComboBoxEntry(modeBox, "Task1");
addComboBoxEntry(modeBox, "Blinker");
@@ -310,7 +310,7 @@ public class MenuWindow {
addComboBoxEntry(modeBox, gui.getAllGrids().get(i));
}
modeName = new JLabel("Select Figure: ");
modeName = new JLabel("Select Grid: ");
modeName.setBounds(50, 250, 200, 30);
modeName.setFont(text);
modeName.setForeground(Color.decode("#121212"));
+6 -4
View File
@@ -2,7 +2,6 @@ package main;
import data.database.DataBase;
import game.Control;
public class Main {
@@ -13,11 +12,12 @@ public class Main {
public static void main(String[] args) {
// Control control = new Control();
// control.start();
// control.start();
DataBase dataBase = new DataBase();
dataBase.deleteTables();
dataBase.createTables();
// dataBase.deleteTables();
// dataBase.createTables();
// boolean[][] cells = new boolean[44][66];
@@ -35,6 +35,8 @@ public class Main {
//
// System.out.println(dataBase.getAllGrids());
dataBase.getGrid("DUstinkst");
}