Program: 46448
Project: 46448
Buggy source:
public Window(String title,Object content){
  context=Context.getCurrentContext();
  frame=new JFrame(title);
  setContent(content);
  frame.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      frame.dispose();
    }
  }
);
  helper=new Helper();
  helper.setDoubleBuffered(true);
  helper.addComponentListener(new ComponentAdapter(){
    public void componentResized(    ComponentEvent e){
      if (helper.getWidth() != Window.this.content.getWidth() || helper.getHeight() != Window.this.content.getHeight()) {
        BufferedImage newImage=new BufferedImage(helper.getWidth(),helper.getHeight(),BufferedImage.TYPE_4BYTE_ABGR);
        Graphics g=newImage.getGraphics();
        g.drawImage(Window.this.content.image,0,0,null);
        Window.this.content.image=newImage;
      }
    }
  }
);
  helper.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent ke){
      System.out.println("String_Node_Str" + ke.getKeyCode() + "String_Node_Str"+ ke.getKeyChar());
      if (onKeyDown != null) {
        NativeObject no=new NativeObject();
        ScriptableObject.putProperty(no,"String_Node_Str",new Double(ke.getKeyCode()));
        ScriptableObject.putProperty(no,"String_Node_Str",new Double(ke.getKeyCode()));
        Context.enter(context);
        onKeyDown.call(context,onKeyDown,onKeyDown,new Object[]{no});
      }
    }
    public void keyReleased(    KeyEvent ke){
      if (onKeyUp != null) {
        NativeObject no=new NativeObject();
        ScriptableObject.putProperty(no,"String_Node_Str",new Double(ke.getKeyCode()));
        ScriptableObject.putProperty(no,"String_Node_Str",new Double(ke.getKeyCode()));
        Context.enter(context);
        onKeyUp.call(context,onKeyUp,onKeyUp,new Object[]{no});
      }
    }
    public void keyTyped(    KeyEvent ke){
      System.out.println("String_Node_Str" + ke.getKeyCode() + "String_Node_Str"+ ke.getKeyChar());
    }
  }
);
  frame.getContentPane().add(helper);
  frame.pack();
  frame.setVisible(true);
  helper.requestFocus();
  frame.setResizable(false);
}

Fixed version (ground truth):
public Window(String title,Object content){
  context=Context.getCurrentContext();
  frame=new JFrame(title);
  setContent(content);
  frame.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      frame.dispose();
    }
  }
);
  helper=new Helper();
  helper.setDoubleBuffered(true);
  helper.addMouseListener(new MouseListener(){
    public void mouseClicked(    MouseEvent arg0){
    }
    public void mouseEntered(    MouseEvent arg0){
    }
    public void mouseExited(    MouseEvent arg0){
    }
    public void mousePressed(    MouseEvent arg0){
      System.out.println("String_Node_Str");
      helper.requestFocus();
    }
    public void mouseReleased(    MouseEvent arg0){
    }
  }
);
  helper.setFocusable(true);
  helper.addComponentListener(new ComponentAdapter(){
    public void componentResized(    ComponentEvent e){
      if (helper.getWidth() != Window.this.content.getWidth() || helper.getHeight() != Window.this.content.getHeight()) {
        BufferedImage newImage=new BufferedImage(helper.getWidth(),helper.getHeight(),BufferedImage.TYPE_4BYTE_ABGR);
        Graphics g=newImage.getGraphics();
        g.drawImage(Window.this.content.image,0,0,null);
        Window.this.content.image=newImage;
      }
    }
  }
);
  helper.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent ke){
      System.out.println("String_Node_Str" + ke.getKeyCode() + "String_Node_Str"+ ke.getKeyChar());
      if (onKeyDown != null) {
        NativeObject no=new NativeObject();
        ScriptableObject.putProperty(no,"String_Node_Str",new Double(ke.getKeyCode()));
        ScriptableObject.putProperty(no,"String_Node_Str",new Double(ke.getKeyCode()));
        Context.enter(context);
        onKeyDown.call(context,onKeyDown,onKeyDown,new Object[]{no});
      }
    }
    public void keyReleased(    KeyEvent ke){
      if (onKeyUp != null) {
        NativeObject no=new NativeObject();
        ScriptableObject.putProperty(no,"String_Node_Str",new Double(ke.getKeyCode()));
        ScriptableObject.putProperty(no,"String_Node_Str",new Double(ke.getKeyCode()));
        Context.enter(context);
        onKeyUp.call(context,onKeyUp,onKeyUp,new Object[]{no});
      }
    }
    public void keyTyped(    KeyEvent ke){
      System.out.println("String_Node_Str" + ke.getKeyCode() + "String_Node_Str"+ ke.getKeyChar());
    }
  }
);
  frame.getContentPane().add(helper);
  frame.pack();
  frame.setVisible(true);
  helper.requestFocus();
  helper.requestFocusInWindow();
  frame.setResizable(false);
}