Skip to content

Commit

Permalink
Create .jar and change icons origin
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilamper committed Jun 1, 2024
1 parent ad1cf67 commit 6881797
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/artifacts/money_calculator_jar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;

public class DateFrame extends JFrame implements ActionListener {
Expand All @@ -14,8 +16,9 @@ public class DateFrame extends JFrame implements ActionListener {
private JButton accept;
private JButton cancel;

public DateFrame() {
ImageIcon icon = new ImageIcon("src/main/resources/Money-Calculator.png");
public DateFrame() throws MalformedURLException {
URL url = new URL("https://cdn-icons-png.flaticon.com/512/10059/10059897.png");
ImageIcon icon = new ImageIcon(url);
this.setIconImage(icon.getImage());
this.setTitle("Money calculator");
this.setSize(340, 160);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/software/ulpgc/moneycalculator/swing/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
import software.ulpgc.moneycalculator.fixerws.FixerCurrencyLoader;
import software.ulpgc.moneycalculator.fixerws.FixerExchangeRateLoader;

import java.net.MalformedURLException;
import java.util.List;

public class Main {
public static String date;

public static void main(String[] args) {
public static void main(String[] args) throws MalformedURLException {
DateFrame dateFrame = new DateFrame();
dateFrame.setVisible(true);
while (date == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import javax.swing.*;
import java.awt.*;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -18,8 +20,9 @@ public class MainFrame extends JFrame {
private MoneyDialog moneyDialog;
private CurrencyDialog currencyDialog;

public MainFrame() throws HeadlessException {
ImageIcon icon = new ImageIcon("src/main/resources/Money-Calculator.png");
public MainFrame() throws HeadlessException, MalformedURLException {
URL url = new URL("https://cdn-icons-png.flaticon.com/512/10059/10059897.png");
ImageIcon icon = new ImageIcon(url);
this.setTitle("Money calculator");
this.setIconImage(icon.getImage());
this.setSize(1000,650);
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: software.ulpgc.moneycalculator.swing.Main

Binary file removed src/main/resources/Money-Calculator.png
Binary file not shown.

0 comments on commit 6881797

Please sign in to comment.