Как разместить кнопки по вертикали?
Код:
import java.awt.*;
import javax.swing.*;
public class Main
{
public static void main(String[] args)
{
JFrame frame = new JFrame();
frame.setSize(500, 500);
frame.setDefaultCloseOperation(3);
frame.setLayout(new BorderLayout());
JPanel panel2 = new JPanel();
panel2.setBackground(Color.GRAY);
frame.add(panel2, BorderLayout.LINE_START);
JButton button = new JButton("1");
JButton button2 = new JButton("2");
JButton button3 = new JButton("3");
frame.setVisible( true );
}
}