我有chartPanel
(JFreeChart),buttonPanel
和errorPanel
。BorderLayout問題
frame.add(chartPanel, BorderLayout.PAGE_START);
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
errorPanel = new JLabel("Error String");
errorPanel.setHorizontalAlignment(JLabel.CENTER);
frame.getContentPane().add(buttonPanel, BorderLayout.CENTER);
frame.getContentPane().add(errorPanel, BorderLayout.SOUTH);
當我改變應用程序窗口的高度時,buttonPanel和errorPanel消失了。
當我不使用的JLabel:
frame.add(chartPanel);
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
frame.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
它在應用程序窗口的高度變化的好。如何使它正確,沒有窗口縮放問題?
我不能用這個代碼來縮放應用程序窗口 – Denis