1 Reply Latest reply on Feb 13, 2008 11:33 AM by 843804

    no keyevents on JTextField when adding it through method

      Hi all,
      I generated a simple control with axbridge which just has two JTextFields finally.
      The first one is added in the constructor and the second is added by calling doSomething externally (i.e. from HTML/JavaScript testpage).

      The strange about it is that the first textfield can be edited and the second one not... but why?!?!?

      I checked that the textfields are editable and enabled... both were...
      I registered a keylistener for both textfields... I got events from the first textfield but none from the second...

      Here the simple code:
      package axtest;
      import java.awt.BorderLayout;
      import javax.swing.JComponent;
      import javax.swing.JTextField;
      public class AxTest extends JComponent {
           public AxTest() {
                this.setLayout(new BorderLayout());
                this.add(new JTextField(), BorderLayout.NORTH);
           public void doSomething() {
                this.add(new JTextField(), BorderLayout.SOUTH);
      <form name="test">
      <input type="button" onclick="document.axtest.doSomething()"/>
      <object name="axtest" width="300" height="200" classid="CLSID:65B496AE-BFA3-42A6-B4AD-B6CD515355A1">