I want to place some buttons in a JPanel
at random positions (x,y), and these layout classes are annoying.
Is this even possible in Swing?
You can set the coordinates if you use a null layout:
panel.setLayout(null);
Button b = new Button(....);
panel.add(b);
b.setSize(width, height);
b.setLocation(x,y);
But it is strongly recommended to use layouts. Layout classes are not "annoying", they are your friend if you understand them properly.
I propose reading a tutorial about GridBagLayout, it is easy to understand (kinda html tables) and very powerful.