-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJComponets.java
More file actions
38 lines (31 loc) · 1.03 KB
/
JComponets.java
File metadata and controls
38 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*The controls we use in GUI applications will be Swing components.
These components are defined in the javax.swing package and all have names
beginning with J*/
JFrame;
JComboBox;
JPanel;
JTextArea;
JButton;
JLabel;
JTextField;
JCheckBox;
JRadioButton;
//JList
//A list control is like a combo box with the list portion always visible. Multiple
//selections can be made with a list control.
JScroll;
An object called a layout manager determines how controls are arranged in a
frame. Some of the layout managers and their characteristics are:
FlowLayout Places controls in successive rows, fitting as
many as possible in a given row.
BorderLayout Places controls against any of the four frame
borders.
CardLayout Places controls on top of each other like a deck of
cards.
GridLayout Places controls within a specified rectangular
grid.
GridBagLayout Places controls with a specified very flexible
rectangular grid.
BoxLayout Arranges controls either in a row or column.
SpringLayout Arranges controls with positions defined by
sprints and struts.