私はSwing GUIに取り組んでいて、JSeperator
を追加した後に奇妙で望ましくないギャップを取りました。またはこれをうまく達成するための他のオプション!JSeperatorを使用しているときに異常なギャップ - Java
ビジュアル説明
ギャップがJLabel
"スピード" の前と後にJSlider
明らかです。
関連のコード
control.setLayout(new BoxLayout(control, BoxLayout.X_AXIS));
...another code omitted...
control.add(orientation); //JLabel
control.add(norm); //JRadioButton
control.add(back); //JRadioButton
control.add(new JSeparator(SwingConstants.VERTICAL));
control.add(speedLabel); //JLabel
control.add(speed); //JSlider
control.add(new JSeparator(SwingConstants.VERTICAL));
control.add(turnOutLabel); //JLabel
control.add(right); //JRadioButton
control.add(straight); //JRadioButton
control.add(left); //JRadioButton
私がしたいことすべてが中心とJSeperatorで区切られていることです、
ビジュアル説明
ありがとうございます。
あなたは 'JSeparator'インスタンスに水平の接着剤を試しましたか、空の境界線を実装しましたか? – mrkhrts
@mrkhrtsグルーは助けにならない、それは無限大の単純なもう1つのコンポーネントだ;-) – kleopatra