如何禁用调整大小的功能JFrame
?
我的代码如下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"));