Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non opaque component painting bug



Replying to some things what came up:

1. Pre Java 1.4.2_09 being the issue.
Nope, I have seen it on 1.4.2_09, and ever after. Can not be sure for previous versions though.


2. Custom components painting being the issue.
Nope, as the effect is there even when using standard components.

3. Can be fixed by setting the first container behind the label to being opaque.
Nope, doesn't fix the issue.


I will look into finding something out with Quartz Debugger later on. Who knows what that brings.

I am sending a test JFrame. I achieved the effect when resizing it. Less frequent due to the frame not being overly complex, and thereby less slow in repainting. However, I can get it every time if I slowly resize. Note please that all are standard components, and virtually no changes have been made to them, they were just organized into a layout.

One other thing what comes up is that it comes more often since I started using a CoreDuo iMac for dev. I am not sure if it is just the speed or another core what bring it out more often. Swing painting is performed only by the Event Dispatch Thread, right??? No multithreading directly involved?

Thanks to everybody for the input,
Flor


import java.awt.*; import javax.swing.*; import javax.swing.border.*; /* * Created by JFormDesigner on Wed May 31 10:27:48 CEST 2006 */


/**
* @author Florijan Stamenkovic
*/
public class Test extends JFrame {
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN- BEGIN:variables
private JPanel panel1;
private JLabel label1;
private JRadioButton radioButton4;
private JRadioButton radioButton3;
private JCheckBox checkBox1;
private JRadioButton radioButton1;
private JRadioButton radioButton2;
private JPanel panel2;
private JButton button1;
private JButton button2;
private JScrollPane scrollPane3;
private JList list1;
private JScrollPane scrollPane2;
private JTree tree2;
private JScrollPane scrollPane1;
private JTree tree1;
private JTextField textField1;
private JTextField textField2;
private JTextField textField3;
private JTextField textField4;
// JFormDesigner - End of variables declaration //GEN-END:variables


	public Test() {
		initComponents();
	}

private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN- BEGIN:initComponents
panel1 = new JPanel();
label1 = new JLabel();
radioButton4 = new JRadioButton();
radioButton3 = new JRadioButton();
checkBox1 = new JCheckBox();
radioButton1 = new JRadioButton();
radioButton2 = new JRadioButton();
panel2 = new JPanel();
button1 = new JButton();
button2 = new JButton();
scrollPane3 = new JScrollPane();
list1 = new JList();
scrollPane2 = new JScrollPane();
tree2 = new JTree();
scrollPane1 = new JScrollPane();
tree1 = new JTree();
textField1 = new JTextField();
textField2 = new JTextField();
textField3 = new JTextField();
textField4 = new JTextField();


		//======== this ========
		Container contentPane = getContentPane();
		contentPane.setLayout(new BorderLayout());

//======== panel1 ========
{
panel1.setBorder(new EmptyBorder(10, 10, 10, 10));
panel1.setLayout(new GridBagLayout());
((GridBagLayout)panel1.getLayout()).columnWidths = new int[] {0, 0, 0, 0};
((GridBagLayout)panel1.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0, 0, 0};
((GridBagLayout)panel1.getLayout()).columnWeights = new double[] {0.0, 1.0, 1.0, 1.0E-4};
((GridBagLayout)panel1.getLayout()).rowWeights = new double[] {0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};

//---- label1 ----
label1.setText("Test label");
panel1.add(label1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 5), 0, 0));

//---- radioButton4 ----
radioButton4.setText("text");
panel1.add(radioButton4, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 5), 0, 0));

//---- radioButton3 ----
radioButton3.setText("text");
panel1.add(radioButton3, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 0), 0, 0));

//---- checkBox1 ----
checkBox1.setText("text");
panel1.add(checkBox1, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 5), 0, 0));

//---- radioButton1 ----
radioButton1.setText("text");
panel1.add(radioButton1, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 5), 0, 0));

//---- radioButton2 ----
radioButton2.setText("text");
panel1.add(radioButton2, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 0), 0, 0));

//======== panel2 ========
{
panel2.setLayout(new BorderLayout());

//---- button1 ----
button1.setText("text");
panel2.add(button1, BorderLayout.NORTH);

//---- button2 ----
button2.setText("text");
panel2.add(button2, BorderLayout.SOUTH);

//======== scrollPane3 ========
{
scrollPane3.setViewportView(list1);
}
panel2.add(scrollPane3, BorderLayout.CENTER);
}
panel1.add(panel2, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 5), 0, 0));

//======== scrollPane2 ========
{
scrollPane2.setViewportView(tree2);
}
panel1.add(scrollPane2, new GridBagConstraints(1, 2, 1, 5, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 5), 0, 0));

//======== scrollPane1 ========
{
scrollPane1.setViewportView(tree1);
}
panel1.add(scrollPane1, new GridBagConstraints(2, 2, 1, 5, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
panel1.add(textField1, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 5), 0, 0));
panel1.add(textField2, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 5), 0, 0));
panel1.add(textField3, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 5, 5), 0, 0));
panel1.add(textField4, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 5), 0, 0));
}
contentPane.add(panel1, BorderLayout.CENTER);
// JFormDesigner - End of component initialization //GEN- END:initComponents
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden


This email sent to email@hidden
References: 
 >Re: Non opaque component painting bug (From: Greg Guerin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.