Uploaded by MMM AAA

GUI 1

advertisement
Import javax.swing. Jframe;
Import javax.swing. *;
Creating a frame with TextArea and Button
java.awt.BorderLayout;
• BorderLayout is the default layout for the window objects such as
JFrame, JWindow, JDialog, JInternalFrame etc. BorderLayout arranges
the components in the five regions. Four sides are referred to as
north, south, east, and west. The middle part is called the center.
Each region can contain only one component and is identified by a
corresponding constant as NORTH, SOUTH, EAST, WEST, and CENTER.
• BorderLayout(): It will construct a new borderlayout with no gaps between the
components.
• BorderLayout(int, int): It will constructs a border layout with the specified gaps between
the components.
Action Listener
• The FlowLayout is used to arrange the
components in a line, one after another (in a flow).
It is the default layout of applet or panel.
• setLocationRelativeTo(null)
Download