Set screen size according to system settings
This commit is contained in:
parent
aad53176f8
commit
90ad88ee2f
1 changed files with 1 additions and 3 deletions
|
@ -29,7 +29,6 @@ import java.util.Set;
|
||||||
* @version 2.04 2021/9/11 Test as plugin
|
* @version 2.04 2021/9/11 Test as plugin
|
||||||
*/
|
*/
|
||||||
public class ExBoxFrame extends JFrame implements ActionListener, ItemListener {
|
public class ExBoxFrame extends JFrame implements ActionListener, ItemListener {
|
||||||
private final int UHDTHRESHOLD = 1920;
|
|
||||||
private final String STANDARDENCODING = "UTF-8";
|
private final String STANDARDENCODING = "UTF-8";
|
||||||
|
|
||||||
private JMenuItem connect, exit, open, test, retest, textView, graphicView, clear;
|
private JMenuItem connect, exit, open, test, retest, textView, graphicView, clear;
|
||||||
|
@ -155,8 +154,7 @@ public class ExBoxFrame extends JFrame implements ActionListener, ItemListener {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
double scaleFaktor = (double)Toolkit.getDefaultToolkit().getScreenResolution() / 96.0;
|
||||||
double scaleFaktor = (screenSize.getWidth() <= UHDTHRESHOLD) ? 1 : 2;
|
|
||||||
setFontSize((int) (11 * scaleFaktor));
|
setFontSize((int) (11 * scaleFaktor));
|
||||||
setSize(new Dimension((int) (400 * scaleFaktor), (int) (400 * scaleFaktor)));
|
setSize(new Dimension((int) (400 * scaleFaktor), (int) (400 * scaleFaktor)));
|
||||||
setTitle("ExBox");
|
setTitle("ExBox");
|
||||||
|
|
Loading…
Reference in a new issue