The problem is when I run the code below, I see a white splash on my screen for about maybe 100ms which is extremely annoying:
import java.awt.*; import javax.swing.*; public class MyPanel extends JPanel { public MyPanel() { this.setBackground(Color.black); JTextArea jtext = new JTextArea(10, 20); jtext.setBackground(Color.black); jtext.setForeground(Color.white); jtext.setText("some stuff here"); add(jtext); add(new JButton("some button")); // TODO: gui elements } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame("MyPanel"); frame.getContentPane().add(new MyPanel()); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); frame.setVisible(true); } }); } }
My entire work setup is in dark theme. Equivilant code written in C++ with Qt does not show any white splashs on the same system. I'm using Ubuntu 12.04 and Intel HD Graphics 3000. Please let me know how this can be fixed. I googled this problem but all I found was: "how to create splash screen in java?" which what I'm trying to avoid.