Useful Documents:
------- to be updated -------------------------------------------------------------------------------------------------------------------------------------------
How to copy your PAT code to a Word document.
Swing GUI elements shortcut names: http://www.zuskin.com/java_naming.htm OR Java Naming Convention summary from website.
Flowchart summary - https://www.rff.com/structured_flowchart.php OR Flowchart summary from website. www.draw.io free version has good flowcharting tools.
PAT Documentation structure (same document with a few examples)
PAT Rubric for 2021 Grade 12s.
SAG 2021
How to remove Netbeans Auto Generated Code After Double-Clicking an Object in Design Tab (source)
In the Design mode you select the particular object and click Events under Properties and remove the event from the event property
Centring a jpanel on the screen when it loads:
this.setLocationRelativeTo(null);
this.setLocation(dim.width/2 - this.getSize().width/2, dim.height/2 - this.getSize().height/2);
Source for both: https://stackoverflow.com/questions/20680060/location-of-jframe-in-middle-of-the-window/20680130#20680130
Ucanaccess - When writing a sql query with ucanaccess always use -'s for date format e.g. #2019-07-23# instead of #2019/07/23#
How to add a PDF load button
private void btnHelpActionPerformed(java.awt.event.ActionEvent evt) {
if (Desktop.isDesktopSupported()) {
try {
File myFile = new File("help.pdf");
Desktop.getDesktop().open(myFile);
} catch (IOException ex) {
}
}
}
https://stackoverflow.com/questions/2546968/open-pdf-file-on-the-fly-from-a-java-application
How to set jDatePicker date:
if (dateStr.substring(0, 2).equals("20")) { y = 100; }
int year = y + Integer.parseInt(dateStr.substring(2, 4));
int month = Integer.parseInt(dateStr.substring(5, 7));
int day = Integer.parseInt(dateStr.substring(8, 10));
Date startDate = new Date(year, month, day);
pkrDOB.setDate(startDate);
Why Date is a terrible Java class: https://stackoverflow.com/questions/1969442/whats-wrong-with-java-date-time-api