CPS 209 Lecture 2: Lecture 2 Swing
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.