AWT and Swing
AWT and Swing
• Java AWT is an API that contains large number of classes and methods
to create and manage graphical user interface ( GUI ) applications.
1.GridLayout(): creates a grid layout with one column per component in a row.
2.GridLayout(int rows, int columns): creates a grid layout with the given rows
and columns but no gaps between the components.
3.GridLayout(int rows, int columns, int hgap, int vgap): creates a grid layout
with the given rows and columns along with given horizontal and vertical gaps.
• Jframe f = new JFrame();
• JButton b1 = new JButton("NORTH");;
• f.add(b1, BorderLayout.NORTH);
How to write ActionListener