title: I can't click in this JTextField to edit it, why not?
body: <h2>UPDATE</h2>
  
  <p>This only happens when running on OS X.  The issue isn't present on Windows.  I'm using Eclipse Kepler and Oracle 1.7.0_45.jdk</p>
  
  <hr>
  
  <p>The code below is a basic GUI running from an OSGI declarative services component.  The problem is that when the GUI launches, I can't interact with the <code>JTextField</code> <code>loginField</code>.  I can interact with the <code>JButton</code> <code>loginButton</code>.  If I run the same code as a Java Application I can interact/edit the <code>JTextField</code>.  So the issue must be due to it being launched as an OSGi bundle.  Can anyone shed any light on what the issue might be?</p>
  
  <h2>DoctorDevice.java</h2>
  
  <pre><code>package ie.ucd.sh.doctor;
  
  import org.osgi.service.component.ComponentContext;
  import ie.ucd.sh.db.context.DbContext;
  import java.awt.EventQueue;
  
  /**
   * This class runs the GUI for the Doctor Device.  It connects to the database using the abstraction
   * provided by the ie.ucd.sh.db.context bundle and displays information on the doctor that has logged in
   * into the device.
   * @author Conor Griffin
   */
  public class DoctorDevice {
  
      protected DbContext dbContext;
      DoctorGUI window;
  
      public void activate(ComponentContext ctxt) {
  
          /**
           * Launch the swing GUI and set its DbContext
           */
          EventQueue.invokeLater(new Runnable() {
              public void run() {
                  try {
                      window = new DoctorGUI();
                      window.frame.setVisible(true);
                      window.dbContext = dbContext;
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });
      }
  
      protected void deactivate(ComponentContext ctxt) {
          window.terminate();
      }
  
      public DbContext getContext() {
          return dbContext;
      }
  
      public void setContext(DbContext dbContext) {
          this.dbContext = dbContext;
          System.out.println("DbContext was set to " + dbContext);
      }
  
  }
  </code></pre>
  
  <h2>DoctorGUI.java</h2>
  
  <pre><code>package ie.ucd.sh.doctor;
  
  import javax.swing.JButton;
  import javax.swing.JFrame;
  import javax.swing.JOptionPane;
  import javax.swing.JPanel;
  import javax.swing.JTextArea;
  import javax.swing.JTextField;
  
  import java.awt.GridLayout;
  
  import java.util.Date;
  import java.text.DateFormat;
  import java.text.SimpleDateFormat;
  
  import ie.ucd.sh.db.context.DbContext;
  import ie.ucd.sh.db.context.Doctor;
  import ie.ucd.sh.db.context.Entity.Type;
  import ie.ucd.sh.db.context.Nurse;
  import ie.ucd.sh.db.context.Patient;
  
  import java.awt.event.MouseAdapter;
  import java.awt.event.MouseEvent;
  import javax.swing.JTabbedPane;
  
  public class DoctorGUI {
  
      protected JFrame frame;
      protected DbContext dbContext;
      private static DateFormat df = new SimpleDateFormat("HH:mm:ss");
      private Doctor currentUser;
      private JTextField loginField;
  
      /**
       * Create the application.
       */
      public DoctorGUI() {
          initialize();
      }
  
      /**
       * Initialize the contents of the frame.
       */
      public void initialize() {
          frame = new JFrame();
          frame.setBounds(100, 100, 450, 300);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.getContentPane().setLayout(new GridLayout(0, 2, 0, 0));
  
          JPanel inputPanel = new JPanel();
          frame.getContentPane().add(inputPanel);
          inputPanel.setLayout(null);
  
          JButton loginButton = new JButton("Login");
          loginButton.addMouseListener(new MouseAdapter() {
              @Override
              public void mouseReleased(MouseEvent e) {
                  currentUser = login();
              }
          });
          loginButton.setBounds(137, 6, 82, 29);
          inputPanel.add(loginButton);
  
          loginField = new JTextField();
          loginField.setBounds(6, 5, 134, 28);
          inputPanel.add(loginField);
          loginField.setToolTipText("Enter your ID");
          loginField.setColumns(10);
          loginField.setEditable(true);
  
          JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
          frame.getContentPane().add(tabbedPane);
          loginField.requestFocusInWindow();
      }
  
  
      /**
       * Login the doctor
       * @return
       */
      private Doctor login() {
          int id = 0;
          Doctor doctor = null;
          try {
              id = Integer.parseInt(loginField.getText());
          } catch (NumberFormatException e) {
              e.printStackTrace();
              String title = "Invalid Value";
              String message = "ID must be numeric";
              JOptionPane.showMessageDialog(null, message, title, JOptionPane.ERROR_MESSAGE);
              return doctor;
          }
  
          doctor = (Doctor)dbContext.get(Type.Doctor, id);
          System.out.println(doctor.getFirstName() + " " + doctor.getLastName());
  
          return doctor;
      }
  
      /**
       * Set the JFrame to invisible and throw it away
       */
      public void terminate() {
          frame.setVisible(false);
          frame.dispose();
      }
  }
  </code></pre>
  
  <h2>DbContextClient.xml - The OSGi component definition</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.2.0" activate="activate" deactivate="deactivate" name="DbContextClient"&gt;
     &lt;implementation class="ie.ucd.sh.doctor.DoctorDevice"/&gt;
     &lt;reference bind="setContext" cardinality="1..1" interface="ie.ucd.sh.db.context.DbContext" name="DbContext" policy="static" unbind="getContext"/&gt;
  &lt;/scr:component&gt;
  </code></pre>