DANCEST 303 Lecture Notes - Lecture 28: Terminal Emulator, Javafx, Abstract Window Toolkit
Document Summary
Graphics and event handling: applications are stand-alone applications that can launched from command line. Each application has no restrictions what it can do; Console applications run in a single terminal window; Graphical applications use one or more windows filled with graphical user interface (gui) components such as buttons, text fields, and menus. Graphical applications: a graphical application shows information in a frame window. There exist three main graphics packages: abstract windowing toolkit (awt, swing, javafx. To show a frame in swing, carry out the following steps: Set the size of the frame: frame. setsize(300, 400); Set the title of the frame: frame. settitle("an empty frame"): set the default operation: frame. setdefaultcloseoperation(jframe. exit_on_close), make the frame visible: frame. setvisible(true); Note that to use the jframe class you need to import swing package! Graphical applications: drawing shapes: to display a drawing, define a class (e. g. rectanglecomponent) that extends the.