import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.*; import java.util.ArrayList; import org.jaudiotagger.audio.AudioFile; import org.jaudiotagger.audio.AudioFileIO; import org.jaudiotagger.tag.FieldKey; import org.jaudiotagger.tag.Tag; import org.jaudiotagger.tag.datatype.Artwork; import javax.swing.*; import javax.swing.text.DefaultCaret; public class Main extends JFrame { String textPath = ""; JPanel panel = new JPanel(); Boolean readyState = false; JScrollPane scrollPane; JButton editButton = new JButton("Edit Tags"); int progress = 0; FileUtility fileUtil = new FileUtility(); JProgressBar progressBar = new JProgressBar(); JLabel title = new JLabel("SUPER JUICER DOWNLOAD MUSIC COVERS AND TAG NOW 100% SAFE"); JButton startButton = new JButton("Set .txt File"); static JTextArea outputArea = new JTextArea("this is bery bery bery safe no worries no virus malwar ur monies back granteed"); public Main(){ initializeComponents(); initializeActionsListeners(); } public static void main(String[] args) { new Main().setVisible(true); } private void initializeComponents(){ this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.add(panel); panel.setLayout(new BoxLayout(panel,BoxLayout.PAGE_AXIS)); scrollPane = new JScrollPane(outputArea); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); outputArea.setEditable(false); outputArea.setLineWrap(true); DefaultCaret caret = (DefaultCaret)outputArea.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); panel.add(Box.createRigidArea(new Dimension(0,5))); panel.setBorder(BorderFactory.createEmptyBorder(25,10,20,10)); startButton.setAlignmentX(CENTER_ALIGNMENT); title.setAlignmentX(Component.CENTER_ALIGNMENT); editButton.setAlignmentX(Component.CENTER_ALIGNMENT); progressBar.setStringPainted(true); title.setFont(new Font("Verdana", Font.PLAIN, 14)); panel.add(title); panel.add(Box.createVerticalStrut(10)); panel.add(progressBar); panel.add(Box.createVerticalStrut(10)); panel.add(startButton); panel.add(Box.createVerticalStrut(8)); panel.add(scrollPane); panel.add(Box.createVerticalStrut(5)); panel.add(editButton); this.setSize(550,300); } private void initializeActionsListeners(){ startButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if(textPath.equals("")||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"); } } else{ Runnable runnable = () -> { outputArea.setText(""); startButton.setEnabled(false); downloadAndTag(); startButton.setEnabled(true); }; Thread thread = new Thread(runnable); thread.start(); } } }); editButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e){ } }); } private void downloadAndTag(){ ArrayList songs = fileUtil.txtToArrayList(textPath); progress = 0; for(int i = 0;i