-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0, 1.2.2
-
generic, x86
-
generic, windows_nt
Name: dbT83986 Date: 01/21/99
run the program below:
First time you can see that the listbox and the
scrollbar in the windowsLookandfeel conflict with
each other. In Normal windows programs the scrollbar
track is much lighter.
Push the button now you see the normal motif look
again the normal Metal look.
After that i set the scrollbar to a lighter gray
(track property)
You see that motif and windows is changed.
But metal not!
You must change the background property to do this
This isn't consistent!
import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;
public class ScrollTest extends JFrame implements ActionListener
{
String[] looks = {"com.sun.java.swing.plaf.windows.WindowsLookAndFeel",
"com.sun.java.swing.plaf.motif.MotifLookAndFeel",
"javax.swing.plaf.metal.MetalLookAndFeel"};
int counter = 1;
public ScrollTest()
{
try
{
UIManager.setLookAndFeel(looks[0]);
} catch(Exception e){}
Vector v = new Vector();
for(int i=0; i<30;i++)
{
v.addElement("Johan" + i);
}
JList list = new JList(v);
list.setBackground(Color.lightGray);
JScrollPane pane = new JScrollPane(list);
getContentPane().setLayout(new BorderLayout());
getContentPane().add("Center" , pane);
JButton b = new JButton("ChangeUI");
b.addActionListener(this);
getContentPane().add("North" , b);
pack();
}
public void actionPerformed(ActionEvent e)
{
try
{
UIManager.setLookAndFeel(looks[counter++]);
if(counter == 1)
{
UIDefaults uid = UIManager.getDefaults();
uid.put("ScrollBar.track", new Color(0xFFE0E0E0));
}
SwingUtilities.updateComponentTreeUI(this);
} catch(Exception ex)
{
}
if(counter >2) counter =0;
}
public static void main(String[] args)
{
new ScrollTest().setVisible(true);
}
}
first time bug report:
I must change the WindowsLookAndFeel scrollbar track color everytime because the color is lightGray but that isn't the real
windows color That one is somewhere in the range of 0xFFE0E0E0
This is annoying because i use the lightGray color for
the background of the list.
I also noticed that changing the track color on Metal a must change the background property and changing it on Motif or
Windows i must change the track property this is a inconstitency.
it would Also be nice to have a much better documentation of these lookandfeel properties!
greetings
johan compagner
(Review ID: 52979)
======================================================================
Name: krT82822 Date: 06/28/99
When using the Windows look-and-feel, all
scrollbars use the wrong color for the background
area between the arrows & the thumb. This includes
plain scrollbars as well as JScrollPanes.
The color used is the same plain grey used on the
face of controls, when in native Windows it is a
50% mix of the face color and the lt hilight color.
In many windows color configurations this results
in a checkerboard stipple.
The main impact of this bug is that the plain grey
background of the scrollbar 'bleeds' into the
grey of neighboring components, creating a very
unprofessional look.
(Review ID: 36415)
======================================================================
Name: krT82822 Date: 06/28/99
With JDK 1.2.2 the color of the scroll bar and the background color for JPanel are identical, which causes the two to be indistinguishable from each other (this was not the case with swing 1.0).
G:\MeSH2000>java -version
java version "1.2.2"
Classic VM (build JDK-1.2.2-U, native threads, symcjit)
(Review ID: 84876)
======================================================================
- duplicates
-
JDK-4195048 JScrollBar background not painted properly in Windows LF
-
- Resolved
-