GUI freezes when drawing Wave from animation on JPanel though i used Swing Timer

后端 未结 2 1406
情深已故
情深已故 2020-12-19 23:33

plese look at my code snippets , wha is wrong with it , it frrezes GUI when the Swing timer stats which is repeteadly paints on the jpnael ??

class WaveformP         


        
2条回答
  •  春和景丽
    2020-12-20 00:00

    I'm guessing that your wave drawing code, which is being called from within a paintComponent(...) method is taking longer than you think and is tying up both Swing painting and the EDT.

    If this were my code, I'd consider drawing my waves to BufferedImages once, making ImageIcons from these images and then simply swapping icons in my Swing Timer.

提交回复
热议问题