Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / November 2003

Tip: Looking for answers? Try searching our database.

Did anyone notice Treatment of '_' as word boundary has changed from JDK1.1 to JDK1.3

Thread view: 
Sandip Chitale - 03 Nov 2003 20:00 GMT
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]
>
> }


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.