2
私はここで何か間違っています:ボタンがJSplitPaneを満たすJFrameのJPanelのJSplitPaneに2つのJButtonを配置したいと思います。JSplitPane + MiGLayout:自動サイズ調整を有効にする方法
は、ここで私はJFrameのサイズを変更するとき、私は何を得るのです。
ボタンは通常の大きさのまま、とJSplitPaneのは
私はこれをどのように修正すればよいのadjusting.somethingことはできませんか?
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import net.miginfocom.swing.MigLayout;
public class SplitPaneQuestion {
public static void main(String[] args) {
JFrame frame = new JFrame("SplitPaneQuestion");
JPanel panel = new JPanel();
frame.setContentPane(panel);
panel.setLayout(new MigLayout("","[]","[grow]"));
JSplitPane splitpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
panel.add(splitpane, "");
splitpane.setTopComponent(new JButton("top"));
splitpane.setBottomComponent(new JButton("bottom"));
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
偉大な - 感謝を! –