Swing Components
Swing Components
● setLocation(x,y)
● setBounds(x,y,width,height)
● setIconImage(Image image)
● setTitle(String title)
● setResizable (Boolean resizable)
setLocation(x,y)
setBounds(x,y,width,height)
setResizable(Boolean resizable)
setTitle(String title)
Panel 2
Steps to add a JPanel
1. We need a JFrame
2. Create our JPanel
● JButton
● JLabel
● JTextField
● JPasswordField
Try to place a button on your Panel
setLayout(null) & setBounds(x,y,w,h)
JLabel
JTextField
JPasswordField
JCheckBox(String name, Boolean marked)
JComboBox(String[] options)
JRadioButton(String)
ButtonGroup
JSlider(min,max,current)
Sets large lines every 25.
Sets small lines every 5.
Makes the lines visible
Paints the string with
numbers
JTextArea(rows,columns) and JScrollPane(JTextArea)
Rows
Columns