aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/Main.java
diff options
context:
space:
mode:
authorDonald Shan <xxpinapelzxx@gmail.com>2022-08-21 23:41:25 -0700
committerDonald Shan <xxpinapelzxx@gmail.com>2022-08-21 23:41:25 -0700
commit76362b2cce2426178d0503803791a2def31af4c6 (patch)
tree10bfc93dd218f9d925a9e19865c714468c3c478e /src/main/java/Main.java
parent8047076887b10a8aff91d3c85ba1bf31c200e679 (diff)
Better Error Handling for when no file is selected
Diffstat (limited to 'src/main/java/Main.java')
-rw-r--r--src/main/java/Main.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/main/java/Main.java b/src/main/java/Main.java
index 46723d3..05edb94 100644
--- a/src/main/java/Main.java
+++ b/src/main/java/Main.java
@@ -61,23 +61,28 @@ public class Main extends JFrame {
panel.add(Box.createVerticalStrut(5));
panel.add(editButton);
this.setSize(550,450);
- this.setTitle("amazing program to download and tag all mp3 files");
+ this.setTitle("YTMP3Tagger");
}
private void initializeActionsListeners(){//Add all actionlisteners for buttons
startButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- if(textPath.equals("")||readyState==false){
+ if(readyState==false){
outputArea.setText(outputArea.getText()+"\n"+"txt path has not been set. Launching chooserPane");
System.out.println(".txt path has not been set. Launching chooserPane");
textPath = fileUtil.showTextFileChooser();
- if(!textPath.equals("")){
- showWarning("File has been set.\nMake sure you add a new line for each URL.\nOr else say bye bye to your system32");
- readyState = true;
- startButton.setText("Start Download");
- outputArea.setText(outputArea.getText()+"\n"+"Ready to begin downloading. Press the button");
- System.out.println("Ready to begin downloading. Press the button");
+ try {
+ if (!textPath.equals("")) {
+ showWarning("File has been set.\nMake sure you add a new line for each URL");
+ readyState = true;
+ startButton.setText("Start Download");
+ outputArea.setText(outputArea.getText() + "\n" + "Ready to begin downloading. Press the button");
+ System.out.println("Ready to begin downloading. Press the button");
+ }
+ }
+ catch(Exception ex){
+
}
}
else{
@@ -173,4 +178,4 @@ public class Main extends JFrame {
-}
+} \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage