java.swingx.Timer calls ActionPerformed in EDT . Then the question arises: what time should be done. It could be a call to captureThread.getTempBuffer , it could be a help construct, but I suspect it's just the amount of data you're trying to draw.
Playing with this recently, it takes quite a while to process the waveform.
One suggestion might be to reduce the number of patterns you draw. Instead of drawing each, perhaps draw every second or fourth sample point depending on the width of the component. You should still get the same joke, but without any work ...
UPDATED
All samples, 2.18 seconds

Every 4th sample, 0.711 seconds

Every eighth sample, 0.450 seconds

Instead of drawing in response to a timer, you may need to draw in response to a batch of data.
Since your bootloader thread has a “chunk” of data, it may then be red.
As suggested by HoverCraftFullOfEels, you can first draw this in a BufferedImage and then draw it on the screen ...
SwingWorker can achieve this for you
UPDATED
This is the code that I use to draw the above patterns.
// Samples is a 2D int array (int[][]), where the first index is the channel, the second is the sample for that channel if (samples != null) { Graphics2D g2d = (Graphics2D) g; int length = samples[0].length; int width = getWidth() - 1; int height = getHeight() - 1; int oldX = 0; int oldY = height / 2; int frame = 0; // min, max is the min/max range of the samples, ie the highest and lowest samples int range = max + (min * -2); float scale = (float) height / (float) range; int minY = Math.round(((height / 2) + (min * scale))); int maxY = Math.round(((height / 2) + (max * scale))); LinearGradientPaint lgp = new LinearGradientPaint( new Point2D.Float(0, minY), new Point2D.Float(0, maxY), new float[]{0f, 0.5f, 1f}, new Color[]{Color.BLUE, Color.RED, Color.BLUE}); g2d.setPaint(lgp); for (int sample : samples[0]) { if (sample % 64 == 0) { int x = Math.round(((float) frame / (float) length) * width); int y = Math.round((height / 2) + (sample * scale)); g2d.drawLine(oldX, oldY, x, y); oldX = x; oldY = y; } frame++; } }
I use the AudioStream stream to load a Wav file and create 2D samples.