GRADE 12
JAVA MATERIAL FOR GRADE 12 STUDENTS
Gr 11 – Write to text file
A Java program to write to a text file using PrintWriter (not FileWriter). This program reads in a text file using Scanner - a date and a boolean flag. It adds 45 days to the date and compliments the flag (true to false and false to true) It then writes the new data...
The split method
Reading in a text file into an array of objects using the split( ) method in Java. (There are other ways of doing this for example using useDelimiter( ) with next( ) ) Here is the text file using "#" as the delimiter. Note that there are no extra spaces or strange...
Java NetBeans 17
Java version 17 (JDK 17) is a LTS (Long Term Support version of Java). We use this version together with Apache NetBeans version 17. It is a good idea to uninstall any previous versions of Java and NetBeans using Windowns Control Panel, Uninstall software. Click here...
PAT image problems
Your Java PAT project and image problems using NetBeans. JFrame Form. Images are too big. They are the wrong "shape" or size. Resizing your images. Aspect ratio. Background images. Images on action buttons. Layers. Layered pane. And finally when you run your...
Gr 11 – Date time methods
Java - LocalDate, LocalTime, LocalDateTime These date time classes have a number of methods. Here is the list . . . Cautionary: Some of these methods are static, some are non-static, some need parameters, some are void, some are typed. See code examples for more...
Methods of Array class
Java has an "array" class that offers many useful methods that you can use in your grade 12 PAT. All the methods are static i.e. "Array.nameOfTheMethod". Here is a list of methods you mind find useful . . . Arrays.toString(original array) Arrays.sort(original array)...
Gr 11, 12 – SQL tips
SQL TIPS for exams. STUDY the database first (at least 5 full minutes). Study both the data and the fields. Know how many records are in each table so that you can recognize any potential errors in the returned dataset. The better you understand the database, the...
PAT – How to start
PAT - How to start lesson You will need your Funworks grade 12 Java text book page 152 onwards There is also an alternative handout called Grade 12 Performance Assessment Task (PAT) Meeting in _General_-20230126_145010-Meeting Recording.mp4
Gr 12 – Netbeans projects packages classes
Being able to move your work from one computer to another, from one school to another, and being able to work on your Java projects from any terminal that has internet access . . . Understanding how Networks works with One Drive, projects, packages, classes, the dist...
Gr – 11/12 GUI images problem
Many learners have the problem of missing images from their Java JFrameForms when they move their PAT projects from one computer to another. The reason for this is that the path to the image has been hard coded (see examples below) In lines 81, 82 and 91 the image...