-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta2
-
x86
-
windows_2000
-
Verified
Name: bsC130419 Date: 06/06/2001
D:\data\edu\java\jdk14>java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b64)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b64, mixed mode)
1. - start attached java program with JDK 1.4 (>java jdk14.ListScrollingTest)
- click into list
- type b -> does not scroll (would expect to select item "B one7")
- type B (shift-b) -> selects item "B one7" in list
2. Source code for test-program used:
----
package jdk14;
import javax.swing.JScrollPane;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import java.util.Vector;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JList;
/**
* Brings up a JList with several (alphabetically sorted) items.
* Used to test first-character scrolling and wheel-mouse-scrolling.
*
* Creation date: (18.05.2001 13:48:05)
* @author: Peter Gassmann (###@###.###)
*/
public class ListScrollingTest extends JFrame {
class Dummy{
private String text_;
public Dummy(String aText){
text_ = aText + " (Dummy)";
}
public String toString(){
return text_;
}
}
/**
* ListScrollingTest constructor comment.
*/
public ListScrollingTest(String aTitle) {
super(aTitle);
initialize();
}
/**
* Insert the method's description here.
* Creation date: (18.05.2001 13:51:29)
*/
private void initialize() {
Vector data = new Vector();
data.add("A one1");
data.add("A one2");
data.add("A one3");
data.add("A one4");
data.add("A one5");
data.add("A one6");
data.add("B one7");
data.add("B one8");
data.add("B one9");
data.add(new Dummy("C one0"));
data.add("C one1");
data.add("C one2");
data.add(new Dummy("D one3"));
data.add("D one4");
data.add("D one5");
data.add("e one6");
data.add("E one7");
data.add("E one8");
data.add("E one9");
data.add(new Dummy("f one0"));
data.add(new Dummy("f one1"));
data.add(new Dummy("F one2"));
data.add("F one3");
data.add("F one4");
data.add("g one5");
data.add("g one6");
data.add("G one7");
data.add("G one8");
data.add("G one9");
data.add("h one0");
data.add("h one1");
data.add("H one2");
data.add("H one3");
data.add("H one4");
data.add("i one5");
data.add("I one6");
data.add("I one7");
data.add("I one8");
data.add("I one9");
JList list = new JList(data);
list.setVisibleRowCount(15);
JPanel panel = new JPanel(new BorderLayout());
panel.add(new JScrollPane(list), BorderLayout.CENTER);
setContentPane(panel);
}
/**
* Starts the application.
* @param args an array of command-line arguments
*/
public static void main(java.lang.String[] args) {
JFrame frame = new ListScrollingTest("frame with list");
frame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
frame.pack();
frame.setVisible(true);
}
}
----
3. I would expect scrolling to be case-insensitive, as this is also the case in
most Windows applications (e.g. Explorer)
The problem is due to the code in JList.getNextMatch() and JTree.getNextMatch(),
which uses String.startsWith() to find the next item to select.
(Review ID: 125819)
======================================================================
- duplicates
-
JDK-4467972 JList, JTree First Letter Key Navigation is Case Sensitive
-
- Closed
-