Download presentation
Presentation is loading. Please wait.
Published byPenelope White Modified over 9 years ago
2
GUI – Graphic User Interface Up to now in the programs we have written all output has been sent to the standard output device i.e.: the DOS console. A GUI presents a windows interface to a program. A GUI gives a distinctive “look” and “feel”.
3
GUI Applications and how they are built. GUI components java.awt (Abstract Window Toolkit) and javax.swing (Swing Components).
4
Components and the Container object. As the name suggests the Container object is an object that can contain other GUI objects. A Frame is a type of container.
5
import javax.swing.*; import java.awt.*;
6
import javax.swing.*; import java.awt.*; public class JFrameEg extends JFrame { public JFrameEg() { super("JFrameEg: Testing JFrame"); setSize(300,150); setVisible(true); } public static void main(String args[]) { JFrameEg example = new JFrameEg(); }
8
Can use GUI components to get input from the user and display output Components are placed in a container and the container is shown to the user in the form of a window When you create your component object you must add it to the container, otherwise it will not be visible
9
Components and the layout manager object. Layout manager and logical arrangement of components
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.