title: SwingWorker not working when I create a jar file
body: <p>I have the following code:</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.event.*;
  import java.util.List;
  import java.util.concurrent.Executor;
  import java.util.concurrent.Executors;
  public class KaraokeMachine extends JFrame implements ActionListener
  {
  ClassLoader Idr = this.getClass().getClassLoader();
  java.applet.AudioClip everythingIsAwesome = JApplet.newAudioClip( Idr.getResource( "everything is awesome.wav" ) );
  JLabel lbl1 = new JLabel( "" );
  JButton btn = new JButton( "Play" );
  JPanel pnl = new JPanel();
  final Executor executor = Executors.newCachedThreadPool();
  
  public KaraokeMachine()
  {
      super( "Karaoke" );
      setSize( 520, 280 );
      setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
      pnl.add( lbl1 );
      pnl.add( btn );
      btn.addActionListener( this );
      add( pnl ); setVisible( true );
  }
  
  public void actionPerformed( ActionEvent event )
  {
      if ( event.getSource() == btn )
      {
              SwingWorker&lt;Void, String&gt; worker = new SwingWorker&lt;Void, String&gt;()
              {
                  @Override
                  protected Void doInBackground() throws Exception
                  {
                      everythingIsAwesome.play();
                      this.publish("Everything");
                      Thread.sleep( 600 );
                      this.publish("Everything is");
                      Thread.sleep( 400 );
                      this.publish("Everything is Awesome!");
                      Thread.sleep( 2000 );
                      this.publish("Everything");
                      Thread.sleep( 600 );
                      this.publish("Everything is");
                      Thread.sleep( 400 );
                      this.publish("Everything is cool");
                      Thread.sleep( 400 );
                      this.publish("Everything is cool when");
                      Thread.sleep( 400 );
                      this.publish("Everything is cool when you're");
                      Thread.sleep( 400 );
                      this.publish("Everything is cool when you're part");
                      Thread.sleep( 150 );
                      this.publish("Everything is cool when you're part of");
                      Thread.sleep( 150 );
                      this.publish("Everything is cool when you're part of a");
                      Thread.sleep( 150 );
                      this.publish("Everything is cool when you're part of a team");
                      Thread.sleep( 1000 );
                      this.publish("Everything");
                      Thread.sleep( 600 );
                      this.publish("Everything is");
                      Thread.sleep( 400 );
                      this.publish("Everything is Awesome!");
                      Thread.sleep( 1500 );
                      this.publish("When");
                      Thread.sleep( 300 );
                      this.publish("When you're");
                      Thread.sleep( 300 );
                      this.publish("When you're livin'");
                      Thread.sleep( 300 );
                      this.publish("When you're livin' in");
                      Thread.sleep( 300 );
                      this.publish("When you're livin' in a");
                      Thread.sleep( 300 );
                      this.publish("When you're livin' in a dream!");
                      Thread.sleep( 300 );
                      return null;
                  }
              @Override
              protected void process( List&lt;String&gt; res )
              {
                  for(String text : res)
                  {
                      lbl1.setText(text); 
                  }
                  }
          };
          executor.execute(worker);
      }
  }
  public static void main( String[] args )
  {
      KaraokeMachine karaoke = new KaraokeMachine();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>When I make this into a class file, it works fine but when I make it into a jar file, i get the following error:</p>
  
  <blockquote>
    <p>Exception in thread "AWT-EventQueue-0" java.lang.NoClassDegFoundError: KaraokeMachine$1</p>
  </blockquote>
  
  <p>Does anyone know how to change the code so the swingworker works in a jar file?</p>