Graphical User Interface Flashcards
Procedural programming
is about writing procedures or methods that perform
operations on the data
Object-oriented programming(OOP)
about creating objects that contain both data and
methods.
● OOP permits higher level of abstraction than traditional procedural-Oriented
Languages (such as C).
You can create high-level abstract data types called classes
mimic real-life
things.
● These classes are self-contained and are reusable.
Graphical User Interface (GUI)
A graphical user interface (GUI) is a system of interactive visual components for computer software. A GUI allows a user to communicate with a computer through the use of symbols, icons, menus, and pointing devices. A GUI displays objects that convey information and represent actions that can be taken by the user.
Ide
Integrated development environments, or IDEs, are software platforms that provide programmers and developers a comprehensive set of tools for software development in a single product. IDEs are built to work with specific application platforms and remove barriers involved in the lifecycle of software development.
API is the acronym for
application programming interface
● a software intermediary that allows two applications to talk to each other.
● APIs are an accessible way to extract and share data within and across
organizations.
There are currently three sets of Java APIs for graphics programming:
AWT (Abstract Windowing Toolkit), Swing and JavaFX
Programming GUI with AWT
:AWT package
AWT is huge! It consists of 12 packages of 370 classes (Swing is even bigger, with 18
packages of 737 classes as of JDK 8). Fortunately, only
2 packages - java.awt and java.awt.event - are commonly-used.
The java.awt package contains the core AWT graphics classes:
● GUI Component classes, such as Button, TextField, and Label.
● GUI Container classes, such as Frame and Panel.
● Layout managers, such as FlowLayout, BorderLayout and GridLayout.
Custom graphics classes, such as Graphics, Color and Fon
The java.awt.event package supports event handling
● Event classes, such as ActionEvent, MouseEvent, KeyEvent and WindowEvent,
● Event Listener Interfaces, such as ActionListener, MouseListener,
MouseMotionListener, KeyListener and WindowListener,
● Event Listener Adapter classes, such as MouseAdapter, KeyAdapter, and
WindowAdapter.
AWT provides a platform-independent and device-independent interface to develop
graphic programs that runs on all platforms, including
Windows, macOS, and Unixes.
There are two groups of GUI elements:
Component (Widget, Control): Components are elementary GUI entities, such
as Button, Label, and TextField. They are also called widgets, controls in
other graphics systems.
- Container: Containers, such as Frame and Panel, are used to hold
components in a specific layout (such as FlowLayout or GridLayout). A
container can also hold sub-containers.
Class
You cannot write any program in Java without having a class. word class, isn’t capitalized. It is very important
that you keep this in mind, otherwise your program will return an error.
Curly braces
Curly braces are the outline of the code you are running; everything
inside of them belongs to the function, class, or method you are
running
Indentation
Indentation is one of the main things you need to check over to make
sure that your code works the way you want it to.
Main method
You’ll notice that on the next line of code, it says public static void
main(String[] args) {}.
• This is basically the main method showing that you can access the
code file anywhere