The basic approach is this:
collect your audio data that you want to display. This may be the raw audio samples or may be the result of processing (e.g. averaging across N samples, or taking every Nth sample) to provide scaling on the x-axis. (Without scaling, you will need 48000 pixels to display 1 second of audio.)
Given this array of samples, you have to turn it into a aplitude-time plot. As a start you can create a new JPanel and override the paint method to draw the plot.
E.g.
public void paint(Graphics g)
{
short[] samples; // the samples to render - get this from step 1.
int height = getHeight();
int middle = height/2;
for (int i=0; i<samples.length; i++)
{
int sample = samples[i];
int amplitude = sample*middle;
g.drawLine(i, middle+amplitide, i, middle-amplitude);
}
}
This will draw a amplitude-time graph in your component. it will be as heigh as the component, and as wide as the number of samples.
To get animation, you regularly drop in a new short[] array into the component and call repaint() (All on the Swing Event thread, of course!).
Good luck!