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
|
||||
*/
|
||||
public class ExBoxFrame extends JFrame implements ActionListener, ItemListener {
|
||||
private final int UHDTHRESHOLD = 1920;
|
||||
private final String STANDARDENCODING = "UTF-8";
|
||||
|
||||
private JMenuItem connect, exit, open, test, retest, textView, graphicView, clear;
|
||||
|
@ -155,8 +154,7 @@ public class ExBoxFrame extends JFrame implements ActionListener, ItemListener {
|
|||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
double scaleFaktor = (screenSize.getWidth() <= UHDTHRESHOLD) ? 1 : 2;
|
||||
double scaleFaktor = (double)Toolkit.getDefaultToolkit().getScreenResolution() / 96.0;
|
||||
setFontSize((int) (11 * scaleFaktor));
|
||||
setSize(new Dimension((int) (400 * scaleFaktor), (int) (400 * scaleFaktor)));
|
||||
setTitle("ExBox");
|
||||
|
|
Loading…
Reference in a new issue