Prelim Flashcards
(42 cards)
A part of Java Foundation Classes (JFC) used to create window-based applications.
Java Swing
The Abstract Windows Toolkit, components are older and not as portable compared to newer frameworks.
AWT
The main window and top-level container where components like buttons, labels, and text fields are added.
JFrame
A container that can hold and organize a group of components.
JPanel
Provides a scrollable view of a component, useful for large datasets.
JScrollPane
A clickable button that triggers an action when clicked.
JButton
A display area for a short text string or image that is non-editable.
JLabel
A single-line text input field for user textual input.
JTextField
A multi-line text input area allowing greater text displays and user input.
JTextArea
an item in a menu
JMenuItem
A container to hold multiple menus, typically situated at the top of a window
JMenuBar
A drop-down menu that contains multiple menu items.
JMenu
An item in a menu that can have attached actions
JMenuItem
An interface used to receive action events typically from GUI components like buttons
ActionListener
A Swing component used to display messages in a pop-up dialog box
JOptionPane
Involves creating a JPanel to hold components and adding them to the JFrame
Adding Components
Makes a JFrame visible or hides it accordingly.
void setVisible(boolean)
Sets the title of the JFrame, allowing identification of the window.
void.setTitle(String)
Which layout manager is used if components are placed at specific positions using setBounds()?
null()
Defines what happens when the frame is close
void. setDefaultCloseOperation(JFrame.)
Allows or disallows resizing of the frame
void. setResizable()
Return’s a JFrame’s title
String. getTitle()
Override the default behavior for the JFrame to be positioned in the upper-left corner of the computer screen’s desktop; the first two arguments are the horizontal and vertical positions of the JFrame’s upper-left corner to the desktop, and the final two arguments set the width and height
void. setBounds(int x, int y, witdth, height)
Indicates that a Component-defined action occurred, like button clicks.
ActionEvent