title: Currency Exchange API Java GUI
body: <p>I am fairly new to programming of this level and I was wondering if someone could help me with this.</p>
  <p>So I am trying to create a currency exchange app using Java, and I have a problem updating the values on the GUI to reflect the new value on the API. Essentially ever so often the values change and it shows on the console, however, the GUI value never updates and stays the same.</p>
  <p>I thought ActionListener would help solve this problem but either I have not implemented it properly or I haven't googled and come up with a solution properly.</p>
  <p>Thank you in advance for any help :)</p>
  <p>Here is my code:
  GUI.java</p>
  <pre><code>public class GUI extends JFrame {
      
      static Arb arb = new Arb();
  
      private JPanel contentPane;
    public static void main(String[] args) throws IOException, InterruptedException {
          
          ActionListener taskPerformer = new ActionListener() {
               public void actionPerformed(ActionEvent evt) {
                   try {
                      arb.runUpdate_fx(&quot;anAPI&quot;);
                  } catch (IOException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
               }
           };
           Timer timer = new Timer(100 ,taskPerformer);
           timer.setRepeats(true);
           timer.start();
   
           Thread.sleep(5000);
          
          EventQueue.invokeLater(new Runnable() {
              public void run() {
                  try {
                      GUI frame = new GUI();
                      frame.setVisible(true);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });
      }
  
      public GUI() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 1121, 765);
        contentPane = new JPanel();
        contentPane.setBackground(Color.BLACK);
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        contentPane.setLayout(new BorderLayout(0, 0));
        setContentPane(contentPane);
  
        JTextPane FXRate = new JTextPane();
        FXRate.setForeground(new Color(255, 255, 255));
        FXRate.setBackground(new Color(0, 0, 0));
        FXRate.setEditable(false);
        FXRate.setFont(new Font(&quot;Tahoma&quot;, Font.BOLD, 11));
        panel_1.setLayout(new FlowLayout(FlowLayout.LEADING, 5, 5));
        FXRate.setText(&quot;FX Rates\r\n\r\nEUR-AUD FX Rate: &quot; + arb.fxEURAUD + &quot;\r\nEUR-USD FX Rate: &quot; + arb.fxEURUSD);
        panel_1.add(FXRate);
      }
  }
  </code></pre>
  <p>Result:
  EUR-AUD: 1.646659
  <strong>after sometime</strong>
  EUR-AUD: 1.646659</p>
  <p>Expected Result:
  EUR-AUD: 1.646659
  <strong>after sometime</strong>
  EUR-AUD: 1.80102</p>