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

RTL component orientation, Tab movement is always Left To Right

    XMLWordPrintable

Details

    • beta2
    • generic, x86
    • generic
    • Verified

    Description



      Name: jbT81659 Date: 02/28/2001

      OS: all Os's
      JDK: 1.4.0-Beta-b52


      Tab movement between components is always left to right.
      TAB does not respect component orientation inherited from the locale.

      To reproduce bug:
      1- Compile and run the test case under an RTL localized platform (Solais sparc with arabic locale or windows-Hebrew
      enabled)
      2- When the frame is displayed on screen, Press the "Click here ..." Button
      3- Note that a JOptionPane is displayed
      4- Note that this test case component orientation is RTL
      5- Note that the "Yes" button has the focus
      6- Press TAB key
      7- Note that focus jumps to first button from left ("NO")
      8- Press TAB again
      9- Note that middle button have focus now
      10- Press TAB again
      11- Note that focus moved to "Yes" button
      12- repeat previous steps to get familiar with behavior

      /* $Header: /home/sun/src/jOption/bidi/confirmExample.java,v 1.5 2001/01/26 10:16:19 isam Exp $ */

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

      public class confirmExample extends JPanel implements ActionListener
      {
                      static String str ="\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u0643\u0628\u064a\u0631\u006c\u0069\u006d\u0065\u0020\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e\u05d3\u05d5\u05e8\u05e9\u0020\u05d6\u05de\u05df\u0020\u05dc\u05d9\u05de\u05d5\u05d3\u0020\u05de\u05de\u05d5\u05e9\u05da";
          public confirmExample()
          {
              JButton test = new JButton("Click here to see a ConfirmDialog");
              test.addActionListener(this);
              add(test);
          }
          
          public void actionPerformed(ActionEvent e)
          {
              int result;
       
                      SwingUtilities.applyComponentOrientation(this, ComponentOrientation.LEFT_TO_RIGHT);
              result = JOptionPane.showConfirmDialog(this , str);
                                           
              if(result == JOptionPane.YES_OPTION)
              {
                  System.out.println("Yes_Option!");
              }
              else if(result == JOptionPane.NO_OPTION)
              {
                  System.out.println("No Option");
              }
              else if(result == JOptionPane.CANCEL_OPTION)
              {
                  System.out.println("Cancel Dialog");
              }
              else if(result == JOptionPane.CLOSED_OPTION)
              {
                  System.out.println("Closed Option ");
              }
          }
         
          public Dimension getPreferredSize()
          {
              return new Dimension(300, 300);
          }
          
          public static void main(String s[])
          {
                      UIManager.put("Label.font", new Font("Lucida Sans Regular", Font.PLAIN, 8));
              JFrame frame = new JFrame(str);

              confirmExample panel = new confirmExample();
              
              frame.getContentPane().add(panel,"Center");
              frame.setSize(panel.getPreferredSize());
              frame.setVisible(true);
              frame.addWindowListener( new WindowAdapter()
              {
                   public void windowClosing( WindowEvent e)
                   {
                       System.exit(0);
                   }
              });
          }
      }


      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              peytoia Yuka Kamiya (Inactive)
              jbenavrasunw Jonathan Benavraham (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: