0
如何禁用调整我的尺寸JFrame
的功能?frame.setResizable(false)不起作用
我的代码如下frame.setResizable(false)
不起作用。
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
SearchIncome frame = new SearchIncome();
frame.setResizable(false);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public SearchIncome()
{
setTitle("DPSS: Search Income");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 790, 400);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
this.setIconImage(Toolkit.getDefaultToolkit().getImage("images\\icon.jpg"));
为了更快提供更好的帮助,请发布[SSCCE](http://sscce.org/)。 – 2013-05-01 12:49:29
您的框架不应该显示太多。因为,我没有看到你为JFrame调用setVisible。 – 2013-05-01 12:56:07
我的框架显示OK – 2013-05-01 12:58:11