makerbot/ReplicatorG — pull request #257 by bostonbusmap (2012-01-15 04:39:17+00:00)
Title: Fix for preview panel not showing in Ubuntu 11.04 with OpenJDK

It's a little bit of a hack, but it should be simple enough to easily understand. The problem comes from a bug in OpenJDK/Java3D which seems to occur when there are two components in the JPanel at once (the gcode and model tabs). My fix is to replace the MainWindow.cardPanel JPanel object with a wrapper class, which ensures that the JPanel only contains one Component at a time. It stores the other hidden Components in its own HashMap, which is accessed when show() is called.

There are checks to make sure that this only happens when Base.isLinux() is true, otherwise it forwards method calls so that the behavior should be exactly what it was before. I did that mostly because I wasn't sure if it would produce any weird flickering or etc on other platforms.