Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accordion 1 progress after April 10 meeting #4

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
371 changes: 371 additions & 0 deletions HTML_JS_v2/html_starting_point.html

Large diffs are not rendered by default.

101 changes: 27 additions & 74 deletions HelloApplication.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
package com.example.reportmissingguns;
package com.example._218scenebuilder;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollBar;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
Expand All @@ -14,90 +21,36 @@
import java.util.List;
import java.lang.StringBuilder;

import javafx.geometry.Orientation;


// Credit to: https://stackoverflow.com/questions/40231858/what-is-rule-to-use-scrollbar-in-javafx

public class HelloApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));

//ScrollBar scroll = new ScrollBar();
//scroll.setOrientation(Orientation.VERTICAL);
//scroll.setMin(0);
//scroll.setMax(400);
//scroll.setValue(50); // Where it starts
//scroll.setLayoutX(180);
//scroll.setLayoutY(75);

// Group root = new Group(fxmlLoader.load());

Scene scene = new Scene(fxmlLoader.load(), 320, 240);
//Scene scene = new Scene(root, 320, 240);
stage.setTitle("Hello!");


stage.setScene(scene);
stage.show();
}

public static void main(String[] args) {
launch();
}


public class WriteIncidentsHelper_v1 {
public List[] updateIncidentsTable(String[] inputParam) {

String url = "jdbc:mysql://localhost:3306/testdb";
String username = "root";
String password = "Code";

try {
Class.forName("com.mysql.cj.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Class not found");
}

try (
Connection conn = DriverManager.getConnection(url, username, password);
) {
StringBuilder query = new StringBuilder();
query.append("insert into incidents values(");
for(int i = 0; i < 16; i++) {
if(i >= 2 && i != 14) {
query.append("\"" + inputParam[i] + "\"");
} else {
query.append(inputParam[i]);
}
if(i < 15) {
query.append(", ");
}
}
query.append(");");

// insert into incidents values(4, 456, "2022-03-13", "10:10:00.0000000", "2022-03-13", "10:11:00.0000000", "345", "6D", "S McIntyre St", "Lakewood", "CO", "80401", "Lakewood PD", "Stolen", null, "TestDescription");

System.out.println(query.toString());


Statement stmnt = conn.createStatement();
int rowCount = stmnt.executeUpdate(query.toString());

List<Integer> ids = new ArrayList<>();
List<String> submitterIds = new ArrayList<>();
List<String> datesOccurred = new ArrayList<>();
List<String> timesOccurred = new ArrayList<>();
List<String> datesReported = new ArrayList<>();
List<String> timesReported = new ArrayList<>();
List<String> incidentHouseNumbers = new ArrayList<>();
List<String> incidentUnitNumbers = new ArrayList<>();
List<String> incidentStreets = new ArrayList<>();
List<String> incidentCities = new ArrayList<>();
List<String> incidentStates = new ArrayList<>();
List<String> incidentZipCodes = new ArrayList<>();
List<String> incidentJurisdictions = new ArrayList<>();
List<String> lostOrStolenList = new ArrayList<>();
List<String> evidenceList = new ArrayList<>();
List<String> additionalDescriptions = new ArrayList<>();



List[] allTogether = new List[16];



return allTogether;


} catch (SQLException e) {
System.out.println("Error - exception");
System.out.println(e.toString());
}
return null;
}
}
}
Loading