CSE 8B Lecture Notes - Lecture 11: Graphical User Interface, Javafx

48 views3 pages

Document Summary

Scene: container for all items in scene. Border, hbox, vbox, flowpane, gridpane: helper classes governing where components appear in. Guide to creating a simple gui: create layoutmanager (stage, create and add components, make scene, set this scene in the stage, set properties. Gridpane: allows for placement of items in a grid. Stackpane: useful for placing items on top of each other. Hbox: allows for placing items side by side. Vbox: allows for placing items top to bottom. Flowpane: can be vertical or horizontal. Items wrap around when they hit edge of window. Imageviewer to view images: line, circle, ellipse, rectangle, path, polygon, polyline, text. In order to create a gui application, you must: extend application, @override. Example of a gui application public class showsquare extends application { public static void main(string[] args) { launch(args); @override public void start(stage primarystage) { primary tage. settitle(cid:894)(cid:862)hello world! (cid:863)(cid:895); Rectangle rect= new rectangle(); rect. setwidth (100); rect. setheight(200); rect. setstroke(color. red); rect. setfill(color. black);

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents