fixed ...
This commit is contained in:
parent
6941497a23
commit
0c6ae26e93
2 changed files with 11 additions and 11 deletions
16
Main.java
16
Main.java
|
|
@ -54,6 +54,9 @@ public class Main {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
rows = r;
|
||||||
|
cols = c;
|
||||||
|
|
||||||
timerLabel = new JLabel(String.format("%04d:%02d:%02d.%03d", 0, 0, 0, 0));
|
timerLabel = new JLabel(String.format("%04d:%02d:%02d.%03d", 0, 0, 0, 0));
|
||||||
|
|
||||||
gameTimer = new Timer(100, new ActionListener() {
|
gameTimer = new Timer(100, new ActionListener() {
|
||||||
|
|
@ -85,11 +88,11 @@ public class Main {
|
||||||
player2.setText(name2 + ": 0");
|
player2.setText(name2 + ": 0");
|
||||||
|
|
||||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
screenSize = new Dimension((int)((((screenSize.getHeight()*4)/5)/r)*2)/3, (int)((screenSize.getHeight()*4)/5)/r);
|
screenSize = new Dimension((int)((((screenSize.getHeight()*4)/5)/rows)*2)/3, (int)((screenSize.getHeight()*4)/5)/rows);
|
||||||
|
|
||||||
if (Toolkit.getDefaultToolkit().getScreenSize().getWidth() < ((c * screenSize.getWidth()) + ((c + 1) * 5))) {
|
if (Toolkit.getDefaultToolkit().getScreenSize().getWidth() < ((cols * screenSize.getWidth()) + ((cols + 1) * 5))) {
|
||||||
screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
screenSize = new Dimension((int)((screenSize.getWidth()*5)/6)/c, (int)((((screenSize.getWidth()*5)/6)/c)*3)/2);
|
screenSize = new Dimension((int)((screenSize.getWidth()*5)/6)/cols, (int)((((screenSize.getWidth()*5)/6)/cols)*3)/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int fontSize;
|
int fontSize;
|
||||||
|
|
@ -105,9 +108,6 @@ public class Main {
|
||||||
|
|
||||||
Font useFont = new Font(testFont.getFont().getName(), Font.PLAIN, fontSize);
|
Font useFont = new Font(testFont.getFont().getName(), Font.PLAIN, fontSize);
|
||||||
|
|
||||||
rows = r;
|
|
||||||
cols = c;
|
|
||||||
|
|
||||||
panels = new JPanel[rows][cols];
|
panels = new JPanel[rows][cols];
|
||||||
btns = new JButton[rows][cols];
|
btns = new JButton[rows][cols];
|
||||||
labels = new JLabel[rows][cols];
|
labels = new JLabel[rows][cols];
|
||||||
|
|
@ -273,10 +273,10 @@ public class Main {
|
||||||
GridBagConstraints gbc = new GridBagConstraints();
|
GridBagConstraints gbc = new GridBagConstraints();
|
||||||
gbc.gridy = 0;
|
gbc.gridy = 0;
|
||||||
|
|
||||||
frame.add(infoPanel, c);
|
frame.add(infoPanel, gbc);
|
||||||
gbc.gridy = 1;
|
gbc.gridy = 1;
|
||||||
|
|
||||||
frame.add(panel, c);
|
frame.add(panel, gbc);
|
||||||
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
frame.pack();
|
frame.pack();
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
javac -source 1.7 -target 1.7 *.java
|
javac -source 1.7 -target 1.7 *.java
|
||||||
IF EXIST Calc.jar DEL /F Calc.jar
|
IF EXIST Memory.jar DEL /F Memory.jar
|
||||||
jar cfm Calc.jar manifest.txt *.class
|
jar cfm Memory.jar manifest.txt *.class
|
||||||
echo off
|
echo off
|
||||||
DEL /F *.class
|
DEL /F *.class
|
||||||
DEL /F *.ctxt
|
DEL /F *.ctxt
|
||||||
cls
|
cls
|
||||||
java -jar Calc.jar
|
java -jar Memory.jar
|
||||||
Loading…
Add table
Add a link
Reference in a new issue