-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
None
-
beta
-
x86
-
windows_nt
THIS BUG HAS BEEN CREATED BECAUSE OF NEED TO PROVIDE DIFFERENT FIX FOR THE BUG 4759306 IN TIGER. ALL INFORMATION HAS BEEN COPIED FROM THAT BUG.
Name: jk109818 Date: 10/07/2002
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows NT Version 4.0
ADDITIONAL OPERATING SYSTEMS :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
In the JColorChooser the setPreviewPanel method does not
have the desired result.
When invoking this method the default PreviewPanel is not
removed from the colorChooser. The new panel is added.
REGRESSION. Last worked in version 1.4
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just try to add a default previewpanel to the
JColorChooser in any program!
EXPECTED VERSUS ACTUAL BEHAVIOR :
When adding a custom preview panel to the colorChooser the
old default previewPanel of the color chooser is still
visible behind the new component.
Expected result is that the old one is removed from the
colorChooser
Looking at the source of the JColorChooser and
BasicColorChooserUI one can see that a previewPanel holder
is created to hold the default colorchooser preview panel.
To this panel the preview component is added.
When replacing the previewpanel the BasicColorChooserUI
tries to remove the previewpanelcomponent from
JColorChooser, it is not in there, because it is in the
previewPanelHolder. Then after it has tried to remove it,
it adds the new component to the SOUTH of the
JColorChooser, above the previewPanelHolder, which because
of this is still visible behind the new
previewPanelComponent.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error messages are generated.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class JColorChooserTest extends JFrame {
public JColorChooserTest(){
super("JColorChooserTest");
JColorChooser cch = new JColorChooser();
JButton button = new JButton("TEST");
cch.setPreviewPanel(button);
getContentPane().add(cch);
setSize(200,200);
setVisible(true);
}
public static void main(String[] args) {
new JColorChooserTest();
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
Manually removing the prieviewPanelHolder JPanel which has
been added when instantiating.
Release Regression From : 1.4
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 165365)
======================================================================
Name: jk109818 Date: 10/07/2002
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows 98 [Version 4.10.2222]
A DESCRIPTION OF THE PROBLEM :
Used to be able to hide the default JColorChooser preview
area by sending an empty panel to the setPreviewPanel method
(i.e.,
colorchooser.setPreviewPanel(new JPanel());) Under the new
FCS build of 1.4.1 an empty panel labeled Preview (and
having a messed up border) is now appearing. (see
http://www.adaptiveview.com/cw/img/snaps/bad14102.png as
compared to
http://www.adaptiveview.com/cw/img/snaps/code_generator.png
- these are screenshots of the same jar file running under
the FCS and previous 1.4.1 versions)
REGRESSION. Last worked in version 1.4.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I'm too busy trying to resolve it (great timing - I just put
out a new version and announced it!)
I'll get back to you with steps/code.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
None. Program runs fine, just looks like $%^#.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER WORKAROUND :
I'm already recommending on my site that Windows users not
use 1.4.1 due to bug ID 4482430 as the people interested in
my software tend to also like to use "non-standard" fonts.
(Review ID: 164642)
======================================================================
Name: jk109818 Date: 10/07/2002
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows NT Version 4.0
ADDITIONAL OPERATING SYSTEMS :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
In the JColorChooser the setPreviewPanel method does not
have the desired result.
When invoking this method the default PreviewPanel is not
removed from the colorChooser. The new panel is added.
REGRESSION. Last worked in version 1.4
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just try to add a default previewpanel to the
JColorChooser in any program!
EXPECTED VERSUS ACTUAL BEHAVIOR :
When adding a custom preview panel to the colorChooser the
old default previewPanel of the color chooser is still
visible behind the new component.
Expected result is that the old one is removed from the
colorChooser
Looking at the source of the JColorChooser and
BasicColorChooserUI one can see that a previewPanel holder
is created to hold the default colorchooser preview panel.
To this panel the preview component is added.
When replacing the previewpanel the BasicColorChooserUI
tries to remove the previewpanelcomponent from
JColorChooser, it is not in there, because it is in the
previewPanelHolder. Then after it has tried to remove it,
it adds the new component to the SOUTH of the
JColorChooser, above the previewPanelHolder, which because
of this is still visible behind the new
previewPanelComponent.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error messages are generated.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class JColorChooserTest extends JFrame {
public JColorChooserTest(){
super("JColorChooserTest");
JColorChooser cch = new JColorChooser();
JButton button = new JButton("TEST");
cch.setPreviewPanel(button);
getContentPane().add(cch);
setSize(200,200);
setVisible(true);
}
public static void main(String[] args) {
new JColorChooserTest();
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
Manually removing the prieviewPanelHolder JPanel which has
been added when instantiating.
Release Regression From : 1.4
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 165365)
======================================================================
Name: jk109818 Date: 10/07/2002
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows 98 [Version 4.10.2222]
A DESCRIPTION OF THE PROBLEM :
Used to be able to hide the default JColorChooser preview
area by sending an empty panel to the setPreviewPanel method
(i.e.,
colorchooser.setPreviewPanel(new JPanel());) Under the new
FCS build of 1.4.1 an empty panel labeled Preview (and
having a messed up border) is now appearing. (see
http://www.adaptiveview.com/cw/img/snaps/bad14102.png as
compared to
http://www.adaptiveview.com/cw/img/snaps/code_generator.png
- these are screenshots of the same jar file running under
the FCS and previous 1.4.1 versions)
REGRESSION. Last worked in version 1.4.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I'm too busy trying to resolve it (great timing - I just put
out a new version and announced it!)
I'll get back to you with steps/code.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
None. Program runs fine, just looks like $%^#.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER WORKAROUND :
I'm already recommending on my site that Windows users not
use 1.4.1 due to bug ID 4482430 as the people interested in
my software tend to also like to use "non-standard" fonts.
(Review ID: 164642)
======================================================================
- relates to
-
JDK-4759306 1.4.1 REGRESSION: JColorChooser.setPreviewPanel does not remove the old one
- Resolved
-
JDK-6199676 REGRESSION: ColorChooser loses preview when change LandF in Java5
- Closed