In JDK 1.1 the '_' was treated as a word break. Using CTRL-RIGHT stops before
'_' in the following example:
|word|_with_underscore
1 2
Starting with caret at position 1 and using CTRL-RIGHT results in caret
at 2.
In JDK 1.3 the '_' is treated as part of the word.
|word_with_underscore|
1 2
Starting with caret at position 1 and using CTRL-RIGHT results in caret
at 2.
Has anyone noticed this?
Here is a sample program for you to try it out.
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class SwingTextArea {
public static void main(String[] args) {
JFrame frame = new JFrame("SwingTextArea Test");
frame.setContentPane(
new JScrollPane(
new JTextArea(
"Some word-with-dashes word_with_underscores for test.")));
frame.setBounds(200,200, 400, 400);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
VK - 03 Nov 2003 23:22 GMT
What programming shell do you use? _ never was a "word boundary" by Java
specs. So it was a "convenience violation" in your shell, whatever it
was (is).
> In JDK 1.1 the '_' was treated as a word break. Using CTRL-RIGHT stops before
> '_' in the following example:
[quoted text clipped - 36 lines]
>
> }