So I have a component that renders very slowly. The problem is that I can only render inside the event handling thready, which shouldn't be freezed.
Long ago in pascal/assembly I used backbuffer and page flipping. I've read that Java supports double buffering, but no info about thread safety.
So the question is, how can I render in a worker thread, and then show it in the event handling one?
Thanks!

You can create a new Image object in the worker thread, get its Graphics, and draw your page to it. Then in the paintComponent swing thread you just need to draw that Image to the Swing Graphics. Google "Java off-screen rendering" for examples and discussions

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.