Wie kann ich Buttons und Labels besser anordnen

Hallo,
ich habe versucht ein programm zu schreiben um mir die Labels & Buttons besser beizubringen,nur wollen sie sich nicht so anordnen wie ich will





Java:
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;


public class Formelsammlung_Menu {

	public static void main(String[] args) {
		run();
	
	}
	public static void run(){
    JFrame start = new JFrame("Menu");
    start.setSize(600, 400);
    start.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
    JLabel menu = new JLabel ("Fach aussuchen");
    menu.setBounds(200, 200, 25, 100);
    start.add(menu);
    start.setVisible(true);
	
    JButton ant[]= new JButton[4];
    ant[0]= new JButton("");
	ant[0].setBounds(52, 90, 120, 40);
	start.add(ant[0]);
	
	ant[1]= new JButton("");
	ant[1].setBounds(52, 160, 120, 40);
	start.add(ant[1]);
	
	ant[2]= new JButton("");
	ant[2].setBounds(220, 90, 120, 40);
	start.add(ant[2]);
	
	ant[3]= new JButton("");
	ant[3].setBounds(220, 160, 120, 40);
	start.add(ant[3]);
    
	}

}
 

Neue Themen


Zurück
Oben