![]() JFrame: The JFrame class is an extension of the AWT Frame class. The JApplet() constructor enables you to create a swing applet instance when you create an instance of the JApplet class. The Swing components that contain an applet need to extend the JApplet class. Swing Control Components Using the Top-level Swing Containers JApplet The JApplet class is an extension of the AWT applet class. Atomic components are used to accept input from a user. Atomic Components: Placed on the intermediate-level swing containers. Intermediate-level Swing Containers: Placed on the top-level containers and contains atomic components. The class hierarchy of the Swing components is categorized into: Top-level Swing Containers: Acts as a container for placing the intermediate-level and atomic swing components, such as panels, frames, buttons, and check boxes. Identifying the Swing Component Class Hierarchy The JComponent class is the root of the Swing hierarchy, which is an extension of the AWT container class. Swing Control Components Swing components contain the Pluggable Look and Feel (PL&F) feature that allows applications to have the same behavior on various platforms. ĪWT Control Components TextField TextArea Button List CheckBox Choice Labels The Component class provides the add() method to add AWT components to containers, such as an applet or a window. All AWT controls in Java are subclasses of the Component class. (Assume that all input values are valid numbers) Create a simple frame ĪWT and Swing Control Components AWT and Swing Control Components Exercises Demos Swing AWTĪWT Control Components An AWT control is a component that enables end users to interact with applications created in Java. Accepts three numbers, displays the largest, smallest. Swing AWT (Abstract Window Toolkit) Some AWT components use native code Platform-dependent Ensure that the look and feel of an application run on different machines be comparable Swing Written entirely using the Java programming language Platform-independent Ensures applications deployed across different platforms have the same appearance Built around a number of APIs that implement various parts of the AWT Can be used with AWT ĭemo MessageBox InputBox Create Frame (AWT) Create Frame (Swing) CenterFrame Įxercises Display two input-boxes that accepts two numbers then shows the result. Swing Similarities: Tools provided by Java for developing interactive GUI applications Provides GUI components that can be used in creating Java applications and applets Ībstract Window Toolkit (AWT) vs. A GUI component is an object with which the user interacts via the mouse, the keyboard or another form of input, such as voice recognition. Ex: Internet Explorer, MS Word, JCreator… GUIs are built from GUI components (controls or widgets-window gadget). Users can learn how to use an app quickly and use it more productively. Presents a user-friendly mechanism for interacting with an application. GUI? Graphical User Interface (pronounced 'GOO-ee“). GUI Programming in Java Presented by Thanh Pham 06/2007 B070038 – NIIT Quang Trung Because Learning Never Stop!Ĭontents Basic Concepts 1 AWT and Swing Control Components 2 Layout Manager 3 Event Handling 4 Other References 5īasic Concepts Basic Concepts Exercises Demos AWT vs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |