Update src/main/java/dev/sillyangel/calc/Calculator.java
All checks were successful
Build the Jar / build (push) Successful in 9s
All checks were successful
Build the Jar / build (push) Successful in 9s
This commit is contained in:
@@ -21,7 +21,8 @@ import dev.sillyangel.calc.CalculatorModes;
|
||||
|
||||
|
||||
public class Calculator extends JFrame implements KeyListener {
|
||||
|
||||
|
||||
public static String APPILCATION_VERSION = "1.0.0pre";
|
||||
private static final long serialVersionUID = 1L;
|
||||
private JPanel contentPane;
|
||||
private JTextField display;
|
||||
@@ -36,12 +37,19 @@ public class Calculator extends JFrame implements KeyListener {
|
||||
protected double result;
|
||||
private String[] Modes = new String[] {"Standard", "Scientific", "Data calculation"};
|
||||
private JComboBox<String> modeselect;
|
||||
|
||||
|
||||
public static final String getVersion() {
|
||||
return APPILCATION_VERSION;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// IntelliJTheme.setup(Calculator.class.getResourceAsStream("/DarkPurple.theme.json"));
|
||||
// FlatMacDarkLaf.setup();
|
||||
// MacDarkRed.setup();
|
||||
MacDarkBlue.setup();
|
||||
MacDarkBlue.setup();
|
||||
System.out.println("\nangel's awesome calculator (acc) " + Calculator.getVersion());
|
||||
System.out.println("created by angel");
|
||||
System.out.println("---------------------------------");
|
||||
try {
|
||||
// UIManager.setLookAndFeel("com.formdev.flatlaf.themes.FlatMacDarkLaf");
|
||||
|
||||
@@ -59,7 +67,6 @@ public class Calculator extends JFrame implements KeyListener {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Calculator() {
|
||||
setBackground(new Color(32, 32, 32));
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
@@ -96,7 +103,8 @@ public class Calculator extends JFrame implements KeyListener {
|
||||
}
|
||||
});
|
||||
|
||||
JPanel panel = new JPanel();
|
||||
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
|
||||
|
||||
GroupLayout gl_contentPane = new GroupLayout(contentPane);
|
||||
gl_contentPane.setHorizontalGroup(
|
||||
gl_contentPane.createParallelGroup(Alignment.LEADING)
|
||||
@@ -125,14 +133,21 @@ public class Calculator extends JFrame implements KeyListener {
|
||||
JMenuBar menubar = new JMenuBar();
|
||||
|
||||
JMenu help = new JMenu("Help");
|
||||
JMenu file = new JMenu("File");
|
||||
|
||||
JMenuItem Exit = new JMenuItem("Exit");
|
||||
Exit.addActionListener(e -> System.exit(1));
|
||||
Exit.setMnemonic('E');
|
||||
|
||||
JMenuItem about = new JMenuItem("About");
|
||||
about.setMnemonic('A');
|
||||
about.addActionListener(e -> aboutActionPerformed());
|
||||
|
||||
|
||||
file.add(Exit);
|
||||
file.setMnemonic('F');
|
||||
help.add(about);
|
||||
help.setMnemonic('H');
|
||||
menubar.add(file);
|
||||
menubar.add(help);
|
||||
setJMenuBar(menubar);
|
||||
|
||||
@@ -451,6 +466,7 @@ public class Calculator extends JFrame implements KeyListener {
|
||||
titleLabel,
|
||||
"a very okay calculator app created in java (uses flatlaf)",
|
||||
" ",
|
||||
"Version " + Calculator.getVersion(),
|
||||
"Copyright " + Year.now() + " angel",
|
||||
linkLabel,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user