isAlive problem..Help to understand how it works
<p>I get this error:</p>

<pre><code>"non-static method isAlive() cannot be referenced from a static context"
</code></pre>

<p>what's wrong with this code..please.</p>

<p>I'd like to detect if the thread is alive...
Any help in terms of code will be highly appreciated..thanks
max</p>

<blockquote>
<pre><code>class RecThread extends Thread {

    public void run() {

        recFile = new File("recorded_track.wav");
        // Output file type
        AudioFileFormat.Type fileType = null;
        fileType = AudioFileFormat.Type.WAVE;

        // if rcOn =1 thread is alive 
        int rcOn;

        try {
            // starts recording
            targetDataLine.open(audioFormat);


            targetDataLine.start();


            AudioSystem.write(new AudioInputStream(targetDataLine),
fileType, recFile);

            if (RecThread.isAlive() == true) {
            rcOn =1;
        }
        else {
        rcOn =0;
    }



        } catch (Exception e) {
            showException(e);
        }

        // update actions

        recAction.setEnabled(true);
        stopRecAction.setEnabled(false);

    }
}
</code></pre>
</blockquote>
