I am noticing a flickering problem when initially displaying a JWindow.
It always flashes white before displaying the correct background color.
In fact it appears to go white, bgcolor, white, and then bgcolor all in
a split second.  I tested on two different machines (P333 and a P2-400)
and both show the same flickering.

Is this a know problem or am I not doing something quite right?  I
searched the Java bug database, but could not find an entry regarding
this issue.  The code below creates a full screen JWindow which always
flickers on initialization.

-Sean


import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class WindowTest implements ActionListener
{
    JWindow         win;
    Container       content;
    JButton         quitButton;

    public WindowTest()
    {
        win = new JWindow();
        content = win.getContentPane();
        content.setLayout(null);
        Dimension screenResolution = win.getToolkit().getScreenSize();
        win.setSize(screenResolution);
        content.setBackground(Color.darkGray);

        // Quit Button
        quitButton = new JButton("quit");
        quitButton.setSize(70,40);
        quitButton.setLocation(500, 500);
        quitButton.addActionListener(this);
        content.add(quitButton);

        win.show();
    }

    public void actionPerformed(ActionEvent e)
    {
        Object src = e.getSource();

        if (src.equals(quitButton))
        {
            System.exit(0);
        }
    }

    static public void main(String[] args)
    {
        WindowTest w = new WindowTest();
    }
}

_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to