CSE 8B Lecture Notes - Lecture 12: Javafx
Document Summary
Scene: container for all items in scene. Border, hbox, vbox, flowpane, gridpane: helper classes governing where components appear in scene. Create layout manager create and add components make scene set properties. Must write a class that implement eventhandler class handlerclass implements eventhandler { // code to do after event is formed. To go around the issue of method/ instance field accessibility, use inner classes when it comes to creating these eventhandler classes public class gui extends application { public static void main(string[] args) { launch(args); // code for gui public void saysomething() { // this class has access to methods defined in gui. java. // like saysomething() and its private instance variables. Inner classes are not subclasses of the class it is inside: they just exist within the scope of the outer class, and are not in a is-a relationship. Inner class/ separate class: good for wanting to reuse the same piece of code class deposithandlerclass implements eventhandler {