1 Reply Latest reply: Mar 22, 2010 6:08 AM by 843807 RSS

    JPasswordField is not recognized by Java Access Bridge

    843807
      Hi,
      I am using Zoomtext 9.1 Reader/Magnifier for accessibilty purpose with my Swing based application. For communication in between the Zoomtext and Swing application I ma using Java Access Bridge 2.1.
      The problem is with JPasswordField. When I am putting focus on the password field it's not reading it out, but when I am typing password in this field, zoom text is reading the typed in alphabet instead of aestrik "*".

      The focus behavior for JTextField is working fine.

      Also unable to read the Message shown in JOption dialog box.

      Could any body help me out?

      Thanks in advance.

      Here is the sample code to see the behavior:
      import javax.swing.*;
      
      import java.awt.*;
      import java.awt.event.ActionEvent;
      import java.awt.event.ActionListener;
      
      public class ZoomTest
      {
      public static void main(String[] args) 
      {
      JTextField userName = new JTextField(10);
      
      JPasswordField password = new JPasswordField(10);
      
      JButton submit = new JButton("Submit");
      submit.setFocusCycleRoot(true);
      
      JMenuBar jMenuBar = new JMenuBar();
      
      JMenu jMenuFile = new JMenu("File");
      jMenuFile.setToolTipText("File");
      
      JMenuItem jMenuItemNew = new JMenuItem("New");
      JMenuItem jMenuItemOpen = new JMenuItem("Open");
      JMenuItem jMenuItemCopy = new JMenuItem("Copy");
      
      jMenuFile.add(jMenuItemNew);
      jMenuFile.add(jMenuItemOpen);
      jMenuFile.add(jMenuItemCopy);
      
      jMenuBar.add(jMenuFile);
      
      JLabel userNameLabel = new JLabel("User Name", JLabel.RIGHT);
      userNameLabel.setLabelFor(userName);
      
      JLabel passwordLabel = new JLabel("Password", JLabel.RIGHT);
      passwordLabel.setLabelFor(password);
      
      final JFrame frame = new JFrame("Login");
      JPanel panel = new JPanel( );
      panel.setLayout(new GridLayout(3, 2, 5, 5));
      panel.add(userNameLabel);
      panel.add(userName);
      panel.add(passwordLabel);
      panel.add(password);
      panel.add(submit);
      submit.setToolTipText("Submit");
      submit.addActionListener(new ActionListener() 
      {
      public void actionPerformed(final ActionEvent e)
      {
      JOptionPane.showMessageDialog(new JFrame(), "Click submit");
      }
      });
      
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setJMenuBar(jMenuBar);
      frame.setContentPane(panel);
      frame.setVisible(true);
      }
      }