I tried to use
dialog.setLayout(BoxLayout.Y_AXIS);
but it doesn't work.
How can I set the layout?
Use this:
dialog.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
Use this: