Several years ago, the association for computing machinery had a library for teaching java associated with the Art and Science of Java textbook. The library is not functional anymore as it was written around JApplet.
I want to create a similar library to used for teaching middle school students. One of the benefits of the library is some of the main class structure could be hidden away.
Here's what I have
- A Class called Main (PSVM + InvokeLater for Swing GUI)
- A Class called CanvasGUI (implements runnable, also has PSVM + InvokeLater)
- A Class named DrawBoxes which Subclasses CanvasGUI.
I think I understand the general classing but the interaction with Netbeans and Maven has my blocked.
So my Main Class and CanvasGUI can be the maven target as it has a MainClass but DrawBoxes cannot as it does not.
In the MainClass. I can call both CanvasGUI and DrawBoxes as runnable.
Help: I am looking for a way to get a simplified entry where a student can just create a class and overwrite the run function to get started.
For Example.
public class DrawBoxes extends CanvasGUI{
// Class Functions
public void run() {
// Set Properties like Size
//Draw Object
}
Right now netbeans will not recognize DrawBoxes from the run menu since the PSVM is in CanvasGUI not DrawBoxes.
Is it possible for Netbeans to recognize this is a subclass of something with a PSVM so it can be run from the GUI and context menu? When i'm done I hope to package everything in a jar so that students can rapidly create programs with just a run and not have to edit pom.xml or any other file in the IDE
Thanks