CPS 209 Lecture 2: Lecture 2 Swing

200 views16 pages

Document Summary

In early java, the abstract window toolkit class library: provides hooks for the gui components of the underlying window system. This created inconsistency in the gui for java applets in different environments limited to only to that which all windowing systems have in common. Swing is an entire framework, not just a library. To paraphrase the comedy stylings of yakov smirnoff, when using a library, you call the methods. When using a framework, the methods call you! Coordinates: java 2d api maintains 2 coordinate spaces: User space: graphics primitives are specified here; device-dependent. Device space: coordinate system of an output device like a tablet, smartphone, screen, etc. Names of all swing component classes start with j, such as jtextfield and jbutton. Massive number of common gui component classes are included in javax. swing: customize their behaviour: extend them, commonly by extending jpanel. Jpanel cannot act on its own, it is a blank canvas on which you can impose behaviour.

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