无法将 JPanel 置于运行模式和 sinthatica 主题的中心。它不居中。没有 Syntatica 主题它就可以工作。有什么问题吗?
我的代码:
//center code
TAB_PANEL1.setLocation((this.getWidth() - TAB_PANEL1.getWidth()) / 2,TAB_PANEL1.getX());
提前致谢!
最佳答案
TAB_PANEL1.setLocationRelativeTo(null);
If the component is null, or the GraphicsConfiguration associated with this component is null, the window is placed in the center of the screen. The center point can be obtained with the GraphicsEnvironment.getCenterPoint method.
关于java - Sinthatica 与 JFrame 调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19622492/