JToggleButtons を JToolBar に配置しようとしています。ボタンを縦と左に揃えたい。私のコードは次のとおりです。
JToolBar toolbar = new JToolBar();
toolbar.setLayout(new FlowLayout());
toolbar.setAlignmentX(FlowLayout.LEFT);
toolbar.add(new JToggleButton("Test"));
toolbar.add(new JToggleButton("Test2"));
toolbar.add(new JToggleButton("Test3"));
toolbar.add(new JToggleButton("Test with a long name"));
また、左にドッキングするとこんな感じ。理想的には、ボタンを互いに垂直に積み重ねる必要があります (それでも左側に配置されたままです)。任意のヒント?