FlowLayout
in the constructor. Components are normally centered in an applet. You can make them left or right justified instead. To do this just pass one of the defined constants FlowLayout.LEFT
, FlowLayout.RIGHT
or FlowLayout.CENTER
to the constructor, e.g.
this.setLayout(new FlowLayout(FlowLayout.LEFT));
this.setLayout(new FlowLayout(FlowLayout.RIGHT));
this.setLayout(new FlowLayout(FlowLayout.CENTER));
Below you see all three variants:
Left Alignment
Center Alignment
Right Alignment