Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4359798

ctrl-shift rightarrow doesn't select rightmost word in JTextField

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.3.0
    • client-libs
    • None

      pressing ctrl-shift right arrow selects the next word in
      a JTextField. it doesn't, however, select the rightmost
      word in the field.

      the following code creates a JTextField. clicking in the word
      'one' & then pressing ctrl-shift rightarrow repeatedly selects
      the words 'one' 'two' 'three' & 'four' but never 'five'

      import javax.swing.*;
      import java.awt.event.*;

      public class test{

      public static void main(String args[]){
      JFrame frame = new JFrame();
      JTextField text = new JTextField(40);
      text.setText("one two three four five");
      frame.getContentPane().add(text);
      frame.addWindowListener(new WindowAdapter(){
      public void windowClosing(WindowEvent e){
      System.exit(0);
      }});
      frame.pack();
      frame.setVisible(true);
      }
      }

      the same holds for ctrl rightarrow (no shift) which moves the
      cursor one word to the right but won't work for the rightmost
      word.

            svioletsunw Scott Violet (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: