html5-img
1 / 9

An Introduction to GUI’s in Java

An Introduction to GUI’s in Java. GUI. 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”. GUI.

dennis
Download Presentation

An Introduction to GUI’s in Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Introduction to GUI’s in Java

  2. GUI • 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 • GUI Applications and how they are built. • GUI components • java.awt (Abstract Window Toolkit) and javax.swing (Swing Components).

  4. GUI • 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. GUI • import javax.swing.*; • import java.awt.*;

  6. Example 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(); } }

  7. OUTPUT

  8. GUI Components: Overview • 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. Setting up the screen to take components • Components and the layout manager object. • Layout manager and logical arrangement of components

More Related