int x = c.getMagicCaretPosition().x;
Point mcp = c.getMagicCaretPosition(); int x = (mcp != null) ? mcp.x : 0;
      public void actionPerformed(ActionEvent event)      {        JTextComponent t = getTextComponent(event);        try          {            if (t != null)              {                Caret c = t.getCaret();                int x = c.getMagicCaretPosition().x;                int pos = Utilities.getPositionBelow(t, t.getCaretPosition(), x);                                if (pos > -1)                  t.setCaretPosition(pos);              }          }        catch(BadLocationException ble)           {            // FIXME: Swallowing allowed?          }      }