Skip to content

Commit

Permalink
Update README & Cleaning after merging
Browse files Browse the repository at this point in the history
  • Loading branch information
HouariZegai committed Feb 23, 2021
1 parent 902f57b commit 7906835
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 55 deletions.
2 changes: 0 additions & 2 deletions .settings/org.eclipse.jdt.apt.core.prefs

This file was deleted.

9 changes: 0 additions & 9 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions .settings/org.eclipse.m2e.core.prefs

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Calculator App
Very basic calculator application created by Java **Swing**.
A very basic calculator application created with Java **Swing**.

[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

## Thank You!
Please ⭐️ this repo and share it with others

### Screenshots
Scientific / Simple | Standard / Colored
Scientific / Dark | Standard / Colored
:------------------:|:-------------------
![Calculator - screenshot](screenshots/simple.PNG) | ![Calculator - screenshot](screenshots/colored.PNG)
![Calculator - screenshot](screenshots/dark.PNG) | ![Calculator - screenshot](screenshots/colored.PNG)

### Requirements 🔧
* Java version 8 or higher.
Expand Down
Binary file added screenshots/dark.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/simple.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 40 additions & 37 deletions src/main/java/com/houarizegai/calculator/Calculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Calculator {
private static final int MARGIN_Y = 60;

private JFrame window; // Main window
private JComboBox<String> comboCalcType, comboTheme ;
private JComboBox<String> comboCalcType, comboTheme;
private JTextField inText; // Input
private JButton btnC, btnBack, btnMod, btnDiv, btnMul, btnSub, btnAdd,
btn0, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9,
Expand Down Expand Up @@ -505,7 +505,7 @@ private void repaintFont() {
String selectedTheme = (String) event.getItem();
switch (selectedTheme) {
case "Simple":
window.getContentPane().setBackground(null);
window.getContentPane().setBackground(null);
btnC.setBackground(null);
btnBack.setBackground(null);
btnMod.setBackground(null);
Expand Down Expand Up @@ -578,42 +578,45 @@ private void repaintFont() {
btnPower.setForeground(Color.WHITE);
btnRoot.setForeground(Color.WHITE);
break;
case "DarkTheme":
case "DarkTheme":
final Color primaryDarkColor = new Color(141, 38, 99);
final Color secondaryDarkColor = new Color(171, 171, 171);

window.getContentPane().setBackground(new Color(68, 68, 68));
btn0.setBackground(new Color(171,171,171));
btn1.setBackground(new Color(171,171,171));
btn2.setBackground(new Color(171,171,171));
btn3.setBackground(new Color(171,171,171));
btn4.setBackground(new Color(171,171,171));
btn5.setBackground(new Color(171,171,171));
btn6.setBackground(new Color(171,171,171));
btn7.setBackground(new Color(171,171,171));
btn8.setBackground(new Color(171,171,171));
btn9.setBackground(new Color(171,171,171));
btnPoint.setBackground(new Color(171,171,171));

btnC.setForeground(new Color(171,171,171));
btnBack.setForeground(new Color(171,171,171));
btnMod.setForeground(new Color(171,171,171));
btnDiv.setForeground(new Color(171,171,171));
btnMul.setForeground(new Color(171,171,171));
btnSub.setForeground(new Color(171,171,171));
btnAdd.setForeground(new Color(171,171,171));
btnEqual.setForeground(new Color(171,171,171));
btnLog.setForeground(new Color(171,171,171));
btnPower.setForeground(new Color(171,171,171));
btnRoot.setForeground(new Color(171,171,171));
btnC.setBackground(new Color(141,38,99));
btnBack.setBackground(new Color(141,38,99));
btnMod.setBackground(new Color(141,38,99));
btnDiv.setBackground(new Color(141,38,99));
btnMul.setBackground(new Color(141,38,99));
btnSub.setBackground(new Color(141,38,99));
btnAdd.setBackground(new Color(141,38,99));
btnRoot.setBackground(new Color(141,38,99));
btnLog.setBackground(new Color(141,38,99));
btnPower.setBackground(new Color(141,38,99));
btnEqual.setBackground(new Color(141,38,99));
btn0.setBackground(secondaryDarkColor);
btn1.setBackground(secondaryDarkColor);
btn2.setBackground(secondaryDarkColor);
btn3.setBackground(secondaryDarkColor);
btn4.setBackground(secondaryDarkColor);
btn5.setBackground(secondaryDarkColor);
btn6.setBackground(secondaryDarkColor);
btn7.setBackground(secondaryDarkColor);
btn8.setBackground(secondaryDarkColor);
btn9.setBackground(secondaryDarkColor);
btnPoint.setBackground(secondaryDarkColor);

btnC.setForeground(secondaryDarkColor);
btnBack.setForeground(secondaryDarkColor);
btnMod.setForeground(secondaryDarkColor);
btnDiv.setForeground(secondaryDarkColor);
btnMul.setForeground(secondaryDarkColor);
btnSub.setForeground(secondaryDarkColor);
btnAdd.setForeground(secondaryDarkColor);
btnEqual.setForeground(secondaryDarkColor);
btnLog.setForeground(secondaryDarkColor);
btnPower.setForeground(secondaryDarkColor);
btnRoot.setForeground(secondaryDarkColor);
btnC.setBackground(primaryDarkColor);
btnBack.setBackground(primaryDarkColor);
btnMod.setBackground(primaryDarkColor);
btnDiv.setBackground(primaryDarkColor);
btnMul.setBackground(primaryDarkColor);
btnSub.setBackground(primaryDarkColor);
btnAdd.setBackground(primaryDarkColor);
btnRoot.setBackground(primaryDarkColor);
btnLog.setBackground(primaryDarkColor);
btnPower.setBackground(primaryDarkColor);
btnEqual.setBackground(primaryDarkColor);
}
};

Expand Down

0 comments on commit 7906835

Please sign in to comment.