Laying Out Components Using Absolute Coordinates : No Layout « Swing « Java Tutorial






import javax.swing.JButton;
import javax.swing.JPanel;

public class Main {
  public static void main(String[] argv) throws Exception {
    JButton component = new JButton();
    JPanel panel = new JPanel(null);
    component.setBounds(1, 1, 100, 100);
    panel.add(component);
  }
}








14.98.No Layout
14.98.1.No LayoutManager: Absolute positioningNo LayoutManager: Absolute positioning
14.98.2.Z OrderZ Order
14.98.3.Without layout manager, we position components using absolute values.
14.98.4.Laying Out Components Using Absolute Coordinates