fram.setLayout(null)을 줬을때


각각의 버튼을 최상위로 올리는법 아시나요?


JFrame frame = new JFrame("comgall");

JButton button1,button2,button3;

   fram.setLayout(null);

frame.add(button1);

frame.add(button2);

frame.add(button3);

button1.setSize(100, 100);

button2.setSize(100, 100);

button3.setSize(100, 100);

button.setLocation(0,0);

button2.setLocation(50,0);

button3.setLocation(100,0);


이렇게 했을때 각각의 버튼이 50씩 겹치는데 이게 겹칠때 button1이 가장 상단에있고 button2는 씹히고 button3이 상단에 있게 할수없나영




이렇게 버튼2는 밑에 깔리고 버튼1하고 버튼3만 보이게 하는방법이영