Compare commits
2 commits
ff0c3f0b98
...
5e93294c38
Author | SHA1 | Date | |
---|---|---|---|
5e93294c38 | |||
25068543ad |
2 changed files with 315 additions and 304 deletions
|
@ -29,6 +29,7 @@ import java.util.Set;
|
|||
* @version 2.04 2021/9/11 Test as plugin
|
||||
*/
|
||||
public class ExBoxFrame extends JFrame implements ActionListener, ItemListener {
|
||||
private final Dimension UHDTHRESHOLD = new Dimension(2000, 1500);
|
||||
private final String STANDARDENCODING = "UTF-8";
|
||||
|
||||
private JMenuItem connect, exit, open, test, retest, textView, graphicView, clear;
|
||||
|
@ -154,8 +155,18 @@ public class ExBoxFrame extends JFrame implements ActionListener, ItemListener {
|
|||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
setFontSize(11);
|
||||
setSize(new Dimension(400, 400));
|
||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
|
||||
double scale = (
|
||||
screenSize.getWidth() > UHDTHRESHOLD.getWidth() &&
|
||||
screenSize.getHeight() > UHDTHRESHOLD.getHeight()) ? 2 : 1;
|
||||
|
||||
scale = Math.max(scale, Toolkit.getDefaultToolkit().getScreenResolution() / 96.0);
|
||||
setFontSize((int) (11 * scale));
|
||||
|
||||
setSize(
|
||||
new Dimension((int)(400 * scale), (int)(400 * scale)));
|
||||
|
||||
setTitle("ExBox");
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
initComponents();
|
||||
|
|
|
@ -63,7 +63,7 @@ public class MyCompetitor implements Comparable<MyCompetitor> {
|
|||
@Override
|
||||
public int hashCode() {
|
||||
int hashCode = 13;
|
||||
hashCode += name.hashCode();
|
||||
hashCode += getName().hashCode();
|
||||
hashCode *= 17;
|
||||
return hashCode + rank;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue