Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置窗口初始最大化失效 #9

Open
drogbababa opened this issue Jul 9, 2017 · 2 comments
Open

设置窗口初始最大化失效 #9

drogbababa opened this issue Jul 9, 2017 · 2 comments

Comments

@drogbababa
Copy link

在程序前面增加了BeautyEye之后,使用frame.setExtendedState(JFrame.MAXIMIZED_BOTH);设置窗口最大化是无效的,请问有什么解决方法吗?

@Yoghurt29
Copy link

Yoghurt29 commented Jul 10, 2017

试了一下,是可以最大化的,可能是在某处有调用setSize()之类的方法? 像下面的代码。
`public static void main(String[] args) {
try
{
UIManager.put("RootPane.setupButtonVisible", false);
org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
}
catch(Exception e)
{
System.out.println("UI覆盖错误!");
}

	JFrame mainActivity = MainActivity.getMainActivity();
    mainActivity.setVisible(true);
    mainActivity.setResizable(false);
    mainActivity.setExtendedState(JFrame.MAXIMIZED_BOTH);//实测最大化有效
    mainActivity.setSize(800, 800);//之后调用setSize()方法就看不见最大化效果
}`

@drogbababa
Copy link
Author

没有啊,我之前有行setBounds,在这之后调用setExtendedState(JFrame.MAXIMIZED_BOTH);,窗口并没有极限最大化。
@Yoghurt29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants