0

I have a rather serious problem running my Swing application on Linux distribution. It is a rendering wrapper, which handles the rendering of images contained in custom objects. The objects are stored in an ArrayList buffer, and painted onto a JPanel by iterating through the buffer and using the 'Graphics' of the panel's paintComponent. The flickering occurs as visible objects (buffer objects) are not being rendered at random. I have tried logging any changes in visibility status for the objects, but they all show as visible, however, it seems as if the paintComponent is omitting certain objects. I am employing double buffering, and therefore I assume that the issue is not related to buffering.

Furthermore, I would like to emphasize that application in question runs flawlessly on both OSX and Windows, but not on Linux distributions such as Debian and Red Hat.

Important: I am using OpenJDK 7 on Debian, while the official Java 8 distribution is used both on OSX and Windows.

Please comment for clarification or more information if needed.

Seal
  • 11
  • 4
  • 1
    You absolutely *must* create and post a valid [mcve] program with your question if you want us to understand why it may be misbehaving. Seriously, asking us to understand your problem without relevant runnable code is bordering on the absurd. – Hovercraft Full Of Eels Jul 04 '17 at 13:38
  • Also, please read the link and the [sscce](http://sscce.org) link before replying. We don't want the whole program, we don't want links, and we don't want non-runnable snippets. This should be a small self-contained program that reproduces the problem, nothing more and nothing less. – Hovercraft Full Of Eels Jul 04 '17 at 13:39
  • Since the program is roughly 2500 lines long, I'll try to make one quickly. – Seal Jul 04 '17 at 13:42
  • Thank you. That would be much appreciated. – Hovercraft Full Of Eels Jul 04 '17 at 13:43
  • Are you using software or hardware rendering? Have you tried any other Linux machines? – Mapsy Jul 04 '17 at 14:18
  • I just made an example, and tried running it. It employs almost the same technique for rendering as my original program. However, this example works well on Debian. I'm not sure whether I should post it anyway, since it doesn't contribute to showing off the problem. – Seal Jul 04 '17 at 14:26
  • I wouldn't bother posting. That it doesn't reproduce the problem suggests that you haven't isolated the problem yet – Hovercraft Full Of Eels Jul 04 '17 at 14:33
  • @AlexT. I have tried it on one Debian machine, and at least two Red Hat machines. – Seal Jul 04 '17 at 15:00
  • _At random_? See also [*Initial Threads*](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/initial.html) and [this](https://stackoverflow.com/a/7788806/230513). – trashgod Jul 04 '17 at 15:55
  • @trashgod Yes, some objects aren't rendered when the repaint methods is called - and it only happens on Linux. – Seal Jul 04 '17 at 16:17
  • Did you detect any thread violations, a common cause of random behavior? – trashgod Jul 04 '17 at 16:19
  • @trashgod No. Also, if the problems are caused by thread violations, wouldn't I experience the same issues on other operating systems? – Seal Jul 04 '17 at 16:23
  • 1
    @Seal: Not at all; one platform may _expose_ a latent thread violation, while others _appear_ to work normally; more [here](https://stackoverflow.com/a/7158505/230513). – trashgod Jul 04 '17 at 16:32

0 Answers0