JPanel loses keyboard focus

Ok, i have a JTextField which is initially disabled. A JPanel draws some stuff and receives keyboard input. When i enable the textfield, type some stuff, then press Esc (which disables it), i cant get the keyboard focus back on the JPanel. Here is an example:
(you can move the red circle before you enable the textfield, after you disable it, you cant move it anymore).
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import java.util.Vector;
public class example extends JPanel implements ActionListener,Runnable {
    JFrame frame;
    JMenuBar menubar;
    JMenu m_file;
    JMenuItem mi_open,mi_close;
    JPanel canvas,northpanel;
    JTextField textfield;
    Image canvasimg;
    Thread thread=new Thread(this);
    private Image dbImage;     // for flickering
     private Graphics dbg;     // for flickering
     int x1=400,y1=200;
    public example() {
        frame = new JFrame("Example");                         // window
        frame.setLayout(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setPreferredSize(new Dimension(1000,700));
        frame.setLayout(new BorderLayout());
        northpanel=new JPanel();
        northpanel.setLayout(null);
        northpanel.setPreferredSize(new Dimension(1000,20));     northpanel.setLocation(0,0);
        menubar=new JMenuBar();
        m_file=new JMenu("File");   
        mi_open=new JMenuItem("Open");
        mi_close=new JMenuItem("Close");
        m_file.add(mi_open);
        m_file.add(mi_close);   
        m_file.getPopupMenu().setLightWeightPopupEnabled(false);   
        menubar.add(m_file);
        northpanel.add(menubar);
        menubar.setLocation(0,0);     menubar.setSize(80,20);
        textfield=new JTextField();
        northpanel.add(textfield);
        textfield.setSize(200,20);     textfield.setLocation(500,0);   
        textfield.setEnabled(false);
        frame.add(northpanel,BorderLayout.NORTH);
        canvas=new JPanel();
        canvas.setLayout(null);
        canvas.setSize(1000,600);
        canvas.setBackground(Color.white);
         frame.add(canvas,BorderLayout.CENTER);      
        frame.pack();
        frame.setVisible(true);       
        thread.start();                                   // start the thread
        textfield.addMouseListener(new MouseAdapter(){
                public void mousePressed(MouseEvent e){
                     textfield.setEnabled(true);
           textfield.addKeyListener(new KeyAdapter() {
             public void keyPressed(KeyEvent e){
                  int key=e.getKeyCode();
                  if(key==27){     // esc
                       textfield.setEnabled(false); 
                       canvas.setEnabled(true);                // not working
                       canvas.requestFocus();
                       canvas.requestFocusInWindow();
           frame.addKeyListener(new KeyAdapter() {
             public void keyPressed(KeyEvent e){                   
                  int key=e.getKeyCode();
                  if(key==37){ //left
                       x1-=5;
                  if(key==38){ //up
                       y1-=5;
                  if(key==39){ //right
                       x1+=5;
                  if(key==40){ //down
                       y1+=5;
    // Create the GUI and show it. 
    private static void createAndShowGUI() {
        JFrame.setDefaultLookAndFeelDecorated(true);
        example ex = new example();
    public void run(){
         while(true){
              try{
                   if(canvasimg==null)repaint();                   
                   Graphics g=canvas.getGraphics();
                   update(g);
                   thread.sleep(30);                                             // 1 sec
              }      catch(InterruptedException ex){}
    // ActionPerformed handles button and menu events
    public void actionPerformed(ActionEvent e){              
    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
    public void update (Graphics g){          // get rid of flicker
          if (dbImage == null){
               dbImage = canvas.createImage (canvas.getSize().width, canvas.getSize().height);
               dbg = dbImage.getGraphics ();
          dbg.setColor (canvas.getBackground ());
          dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
          dbg.setColor (canvas.getForeground());
          paint (dbg);
          g.drawImage (dbImage, 0, 0, this);
     public void paint(Graphics g){
          g.drawImage(canvasimg,0,0,this);          
          g.setColor(Color.red);
         g.fillOval(x1,y1,10,10);
    public void repaint(){     
         if(canvas!=null && canvasimg==null)canvasimg=canvas.createImage(1000,670);
         if(canvasimg==null)return;
         Graphics g=canvasimg.getGraphics();
         if(g==null)return;
         g.setColor(Color.white);
         g.fillRect(0,0,1000,600);
}  

OK great guru since you're so damn confident that you're doing everything right, find out for yourself why this works and yours doesn't.
I could list a few dozen things wrong with your code, but I'd be wasting my keystrokes.import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
public class TextFieldDisableNoProblem extends JPanel {
   JPanel northPanel;
   JMenuBar menubar;
   JMenu m_file;
   JMenuItem mi_open,mi_close;
   JTextField textField;
   int x1 = 400;
   int y1 = 200;
   public TextFieldDisableNoProblem () {
      setBackground (Color.WHITE);
      addKeyListener (new KeyAdapter () {
         public void keyPressed (KeyEvent e){
            int key = e.getKeyCode ();
            switch (key) {
               case KeyEvent.VK_LEFT:
                     x1 -= 5;
                     break;
               case KeyEvent.VK_UP:
                     y1 -= 5;
                     break;
               case KeyEvent.VK_RIGHT:
                     x1 += 5;
                     break;
               case KeyEvent.VK_DOWN:
                     y1 += 5;
                     break;
            repaint ();
   void makeUI () {
      JFrame frame = new JFrame ("");
      frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
      frame.setSize (600, 500);
      frame.setLocationRelativeTo (null);
      menubar=new JMenuBar ();
      m_file=new JMenu ("File");
      mi_open=new JMenuItem ("Open");
      mi_close=new JMenuItem ("Close");
      m_file.add (mi_open);
      m_file.add (mi_close);
      menubar.add (m_file);
      frame.setJMenuBar (menubar);
      textField=new JTextField ();
      textField.setEnabled (false);
      textField.setBounds (200, 0, 200, 20);
      textField.addMouseListener (new MouseAdapter (){
         public void mousePressed (MouseEvent e){
            textField.setEnabled (true);
      textField.addKeyListener (new KeyAdapter () {
         public void keyPressed (KeyEvent e){
            int key = e.getKeyCode ();
            if(key == KeyEvent.VK_ESCAPE){
               textField.setEnabled (false);
               requestFocus ();
      northPanel=new JPanel ();
      northPanel.setLayout (null);
      northPanel.setPreferredSize (new Dimension (600,20));
      northPanel.add (textField);
      frame.add (northPanel,BorderLayout.NORTH);
      frame.add (this, BorderLayout.CENTER);
      frame.setVisible (true);
      requestFocus ();
   public void paintComponent (Graphics g) {
      super.paintComponent (g);
      g.setColor (Color.RED);
      g.fillOval (x1, y1, 10, 10);
   public static void main (String[] args) {
      SwingUtilities.invokeLater (new Runnable () {
         public void run () {
            JFrame.setDefaultLookAndFeelDecorated (true);
            new TextFieldDisableNoProblem ().makeUI ();
}db

Similar Messages

  • Switching windows in Linux/Firefox loses keyboard focus. Workarounds?

    Hi,
    I've been stumbling on an issue in which an applet gets into a state where it can receive mouse events but not keyboard events. This state occurs some of the time when switching from a non-modal dialog to the applet.
    I've witnessed this behavior on:
    Linux (fc8), Firefox 3.0.10, Java plug-in 1.6.0_13, Gnome 2.20.3
    Sun Solaris (5.10), Firefox 3.0.8, Java plug-in 1.6.0_12, Sun Java Desktop System or CDE
    I can not reproduce this behavior using appletviewer, nor can I reproduce it on the Mac (Opera/Firefox/Safari), nor on Windows (Firefox/IE).
    I've crafted some code that shows the behavior:
    FocusApplet.java:
    import javax.swing.JApplet;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    import java.beans.*;
    public class FocusApplet extends JApplet {
      JTextArea infoText;
        Object activeWindow;
        Object focusOwner;
        Object permanentFocusOwner;
           Applet contains two components.
           NORTH: Text field
           CENTER: Info text
           The info text is updated whenever the following
           KeyboardFocusManager properties change:
              activeWindow
           focusOwner
           permanentFocusOwner
      public void init(){
          JTextField tf = new JTextField("Type here");
          infoText = new JTextArea();
          infoText.setEditable(false);
          infoText.setLineWrap(true);
          infoText.setWrapStyleWord(true);
          infoText.setBorder(new EtchedBorder());
          this.add(infoText, BorderLayout.CENTER);
          this.add(tf, BorderLayout.NORTH);
          KeyboardFocusManager focusManager =
           KeyboardFocusManager.getCurrentKeyboardFocusManager();
          activeWindow=focusManager.getActiveWindow();
          permanentFocusOwner=focusManager.getPermanentFocusOwner() ;
          focusOwner=focusManager.getFocusOwner() ;
          updateText();
          focusManager.addPropertyChangeListener(
           new PropertyChangeListener() {
             public void propertyChange(PropertyChangeEvent e) {
              String prop = e.getPropertyName();
              if ("focusOwner".equals(prop)) {
                  focusOwner = e.getNewValue();
                  updateText();
              } else if ("permanentFocusOwner".equals(prop)) {
                  permanentFocusOwner = e.getNewValue();
                  updateText();
              } else if ("activeWindow".equals(prop)) {
                  activeWindow = e.getNewValue();
                  updateText();
          // Create non-modal dialog
          JDialog jdl = new JDialog((Frame)null,"Extra dialog",
                        false/*modal*/);
          jdl.setSize (300,550);
          jdl.setVisible(true);
        public void updateText() {
         infoText.setText("Active window: "+getName(activeWindow)+
              "\nFocus owner: "+getName(focusOwner)+
            "\nPermanent focus owner: "+getName(permanentFocusOwner));
        public String getName(Object obj) {
         return (obj==null) ? "null" : obj.getClass().getName();
    }Applet HTML:
    <applet code="FocusApplet.class" width="400" height="400"></applet>When I run this applet, I can click on the text field ("Type here") and enter text. Then, I switch between the empty dialog box and the applet using the window manager. (I.e., clicking on the dialog, then clicking on the applet.) Sometimes I see the following Keyboard Focus settings when I bring the applet to the front:
    Active window: sun.plugin.viewer.frame.XNetscapeEmbeddedFrame
    Focus owner: javax.swing.JTextField
    Permanent focus owner: javax.swing.JTextField
    In this case, clicking on the text field will allows the user to edit text. Good! However, 10%-50% of the time I get the following settings after I bring the applet to the front:
    Active window: null
    Focus owner: null
    Permanent focus owner: javax.swing.JTextField
    In this case, I can click on the applet, and I can highlight text in the text field, but I can not edit the text. (No carat appears. Bad!) Since there is no keyboard focus owner, the applet appears non-responsive.
    I have a few questions:
    1. Is this a Java plug-in bug? A Firefox bug? Who do I file a bug with, assuming there's not something I'm missing?
    2. Can anyone suggest a workaround?
    Thanks,
    -David-

    I noticed the problem too. Is there any fix or workaround? Friends using Windows say that all is ok.
    Linux x86_64 (Gentoo), Firefox 3.5.1, jre 1.6.0.15.

  • Illustrator CS6 loses keyboard focus when using an extension panel

    OS10.8.2 CS6. When clicking a button on any extension panel (even supplied Kuler), it seems that Illustrator can't get keyboard focus until something else on the screen is clicked. Anyone know a way to fix this? I need to be able to use the keyboard to copy or delete a selected object right after running script....
    Tried running a javascript inline with app.activate() command. Didn't work. Help!!!!

    I noticed the problem too. Is there any fix or workaround? Friends using Windows say that all is ok.
    Linux x86_64 (Gentoo), Firefox 3.5.1, jre 1.6.0.15.

  • Google search loses keyboard focus

    Since iOS8 whenever I select Google (.co.uk) from favourites, as soon as I type the first letter of the search in Safari the keyboard drops out and closes, meaning I have to tap in the search box again to regain the keyboard. Happens almost every time unless I drag the screen down first. Either way it is annoying.
    Anyone else? Any workarounds apart from dragging the page down before starting to type? 
    Or I accept it may be a Google problem not keeping up with latest Safari, but is this a uk-only thing?  I cannot find any other complaints.
    With the first iteration of iOS8 the search box used to drop behind the keyboard, so this is an improvement I guess.
    (ipad mini, non retina.)

    THank you Bob. Forum search was useless!
    John Alders solution is...
    "I think I've cured it. Well I have for me.
    Just suddenly occurred to me it may be something to do with Google predictive searching.
    So I opened a new Google search and went straight to google settings (little cog top right in the Google window), then to Search Settings and changed the setting for predictive search (it doesn't seem to matter to what, as long as you change it), then scroll down and save your setting.
    Once you've changed the setting and saved it you can change it back to your preferred setting, and save again of course."
    I Suspect clearing cookies will clear the fix.

  • Table keyboard focus problem

    Hi,
    I would like to edit a table cell with the keyboard. But I noticed that the table don't lose the focus when
    I use the spacebar to edit the cell. Also the cell don't receive the prompt. Seems to me like a Bug.
    What can be done ?
    regards,
    Lucian

    In your MyEditor Class you define a textfield.... then you add another textfield in your editor panel
    class MyEditor extends AbstractCellEditor
    implements TableCellEditor
    private JComponent myEditorPanel;
    private JTextField myTextField;
    MyEditor()
    myEditorPanel = new MyEditorPanel();
    myTextField = new JTextField();
    public Object getCellEditorValue()
    return null;
    public Component getTableCellEditorComponent(
    JTable table, Object value,
    oolean isSelected,
    int
    row, int column )
    return myEditorPanel; // Problems...
    return myTextField; // Keyboard and focus as
    expected
    class MyEditorPanel extends JPanel
    JTextField tf;
    MyEditorPanel()
    setLayout( new BorderLayout() );
    tf = new JTextField();
    add( tf, BorderLayout.CENTER );
    add( new JButton( "edit" ), BorderLayout.EAST );
    Add an action listener to both the textfield and the button and ensure that editingStopped() is called when the user presses enter

  • Camera Raw loses system focus and becomes inactive

    While working in ACR if I hover over any of the command buttons, Save Image,  Open Image, Cancel, or Done for a few seconds the "tool tip" for the button displays and as soon as I move the mouse again the whole Camera Raw windows loses system focus and becomes inactive (every tab, control, menu, etc., becomes greyed out).  To regain the system focus I must move the mouse to the windows 7 taskbar and then back into Camera Raw.  If the fullscreen checkbox in Camera Raw is active the only way to regain system focus is to press the Windows Key twice on the keyboard and move the mouse out of the taskbar tray.  This gets pretty frustrating.  Any clues?

    It doesn't normally do this, I can assure you.  Normally the tooltips just pop up and Camera Raw stays active.
    Do you have any desktop management software installed, besides what Windows provides?
    Are your video drivers up to date?
    -Noel

  • Lose of focus (mouse click/enter key)

    Hello,
    we have a problem customers are complaining about for quite a while now, but despite our efforts, we can not fix it or at least determine with certainty the problem cause.
    We have an application launching forms apps, and from time-to-time we completely lose the focus on this form (generally after typing ENTER in a filter), I mean by focus, we cannot click anymore (cursor seems to stay on a object), we cannot press enter anymore (we get a 'Not defined key function') and so on...
    I heard somewhere that it could be due to 'KEY-OTHERS' trigger not handling correctly the ENTER-KEY. But I need this trigger for my filters, or is there another way? KEY_ENTER does only navigate from field to another.
    I found something which was able to remove focus lost (kind of a hack while trying to fix this on an on), but the problem is I had to remove this, because it blocks the opening of new windows or popups. It was a mouse-click trigger on forms triggers level:
    Go_Record(:System.Mouse_record);
    Go_Item(:System.Mouse_Item);
    But this blocks any window opening, and it also blocks some other tools we have developed.
    Thanks,
    Best regards,
    G.
    EDIT: Forms 11g, and I am pretty sure we had not that much problems with 10g
    EDIT2: I read the same kind of topics in the forum, but no patch seems to help
    AND we use JRE 1.7....
    Edited by: lakers on Jan 14, 2013 11:56 PM
    Edited by: lakers on Jan 14, 2013 11:59 PM

    this problem occurs with some of versions of JRE. Try with JRE JInitiator 1.3.1.22. Also unstalled all others JRE if exists.
    A file called fmrpcweb.res has also been provided which gives the Microsoft Windows client/server keyboard mappings. To use this file, rename fmrpcweb.res to fmrweb_orig.res, and copy fmrpcweb.res to fmrweb.res. Alternatively, use the term parameter as described above.
    By default, whether deploying client/server or over the Web pressing the ENTER key takes the cursor to the next navigable item in the block. To override this default behavior it is necessary to modify the forms resource file to revise the key mapping details.
    Modify fmrweb.res and change the Forms Function Number (FFN) from 27 to 75 for the Return Key. The line should be changed to the following:
    10 : 0 : "Return" : 75 : "Return"
    By default, the line is displayed with an FFN of 27 and looks as follows:
    10 : 0 : "Return" : 27 : "Return"
    This line should NOT fire the Key-Enter trigger since the Return or Enter key is actually returning the Return function represented by the FFN of 27. The FFN of 75 represents the Enter function and fires the Key-Enter trigger.
    http://docs.oracle.com/cd/E24269_01/doc.11120/e24477/configure.htm#i1077054
    please mark correct/helpful if problem is solved..
    Edited by: Askdineshsinghminhas on Jan 15, 2013 5:28 AM

  • Calling1.4.1 signed applet from Javascript causes keyboard/focus problems

    Pretty sure there's a JRE bug here, but I'm posting to forums before I open one in case I'm missing something obvious :-)
    This issue may be specific to IE, I haven't tested elsewhere yet. Our web application is centered around a signed applet that is initialized with XML data via Javascript. We first noticed the problem when our users started upgrading from the 1.3.x plug-in to the 1.4.x plug-in. The major symptom was that shortcut keys stopped working. I debugged the problem off and on for about a month before I boiled it down to a very simple program that demonstrates the issue (included below). Basically, the program has a function that adds a JButton to a JPanel and registers a keyboard listener (using the new DefaultKeyboardFocusManager class) that prints a message to the console. This function is called by the applet's init() method, as well as by a public method that can be called from Javascript (called callMeFromJavascript()). I also included a very simple HTML file that provides a button that calls the callMeFromJavascript() method. You can test this out yourself: To recreate, compile the class below, JAR it up, sign the JAR, and put in the same dir with the HTML file. Load the HTML file in IE 5.0 or greater, and bring the console up in a window right next to it. Now click the button that says init--you should see the small box appear inside the button that indicates it has the focus. Now press some keys on your keyboard. You should see "KEY PRESSED!!!" appearing in the console. This is proper behavior. Now click the Init Applet from Javascript button. It has removed the button called init, and added one called "javascript". Press this button. Notice there is no focus occurring. Now press your keyboard. No keyboard events are registered.
    Where is gets interesting is that if you go back and make this an unsigned applet, and try it again, everything works fine. This bug only occurs if the applet is signed.
    Furthermore, if you try it in 1.3, signed or unsigned, it also works. So this is almost certainly a 1.4 bug.
    Anyone disagree? Better yet, anyone have a workaround? I've tried everything I could think of, including launching a thread from the init() method that sets up the components, and then just waits for the data to be set by Javascript. But it seems that ANY communication between the method called by Javascript and the code originating in init() corrupts something and we don't get keyboard events. This bug is killing my users who are very reliant on their shortcut keys for productivity, and we have a somewhat unique user interface that relies on Javascript for initialization. Any help or suggestions are appreciated.
    ================================================================
    Java Applet (Put it in a signed JAR called mainapplet.jar)
    ================================================================
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MainApplet extends JApplet implements KeyEventDispatcher
        JPanel test;
        public void init()
            System.out.println("init called");
            setUp("init");
        public void callMeFromJavascript()
            System.out.println("callMeFromJavascript called");
            setUp("javascript");
        private void setUp(String label)
            getContentPane().removeAll();
            test = new JPanel();
            getContentPane().add( test );
            JButton button = new JButton(label);
            test.add( button );
            test.updateUI();
            DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
        public boolean dispatchKeyEvent(KeyEvent e)
            System.out.println("== KEY PRESSED!!! ==");
            return false;
    }================================================================
    HTML
    ================================================================
    <form>
    <APPLET code="MainApplet" archive="mainapplet.jar" align="baseline" id="blah"
         width="200" height="400">
         No Java 2 SDK, Standard Edition v 1.4.1 support for APPLET!!
    </APPLET>
    <p>
    <input type="button" onClick="document.blah.callMeFromJavascript();" value="Init Applet via Javascript">
    </form>

    I tried adding the requestFocus() line you suggested... Same behavior.
    A good thought, but as I mention in my description, the applet has no trouble gaining the focus initially (when init() is called). From what I have seen, it is only when the call stack has been touched by Javascript that I see problems. This is strange though: Your post gave me the idea of popping the whole panel into a JFrame... I tried it, and the keyboard/focus problem went away! It seems to happen only when the component hierarchy is descended from the JApplet's content pane. So that adds yet another variable: JRE 1.4 + Signed + Javascript + components descended from JApplet content pane.
    And yes, signed or unsigned DOES seem to make a difference. Don't ask me to explain why, but I have run this little applet through quite a few single variable tests (change one variable and see what happens). The same JAR that can't receive keyboard events when signed, works just fine unsigned. Trust me, I'm just as baffled as you are.

  • Regaining keyboard focus

    Hello
    I am having a problem with my application. When it is first started it asks for a key press. Or instead you can select something from a JComboBox. If you press a key, it works fine and everything happens as it's supposed to happen. If however, you select something from the JComboBox, something strange occurs and you can no longer press keys as you could just a minute ago. I believe this is because the JComboBox gets the keyboard focus when you use it. This causes the JFrame to lose it's key listening capabilities. How can I solve this problem?
    2 Duke Dollars available.
    Regards
    Jiby

    cud u pls post ur code here

  • Losing keyboard focus  when resetting

    I have Player object which is focusable and works fine. However when I try to reset the object with following code:
         public void reset(){
              t.stop();
              remove(player);
              player = new Player(50,60);
              add(player);
              x=50;y=60;
              t.start();
              System.out.println("reset");
         }I lose the focus on player. Everything else works fine but player isn't getting any keyevents after the reset.

    Ok here's sscce
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    class resetTest extends JPanel{
    Player player = new Player();
         public static void main(String[] args){
              JFrame f = new JFrame("resetTest");
              f.add(new resetTest());
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f.pack();
              f.setVisible(true);
         public resetTest(){
              add(player);
         public Dimension getPreferredSize(){
              return new Dimension(200,200);
         public void reset(){
              remove(player);
              player = new Player();
              add(player);
              System.out.println("reset");
         class Player extends JPanel implements KeyListener{
              public Player(){
                   this.setBorder(BorderFactory.createLineBorder(Color.black));
                   this.setFocusable(true);
                   this.addKeyListener(this);
              public void keyPressed(KeyEvent e){
                   System.out.println(e.getKeyCode());
                   if(e.getKeyCode() == 10){ ((resetTest)getParent()).reset();}
              public void keyReleased(KeyEvent e){}
              public void keyTyped(KeyEvent e){}
    }If you run this you'll notice that it notices key presses fine, but when you reset it with enter key it stops working.

  • On our project site, with Firefox 4 and 5, buttons don't take the keyboard focus if you mouse-click on them. Is this a problem of our site?

    On a page like http://www.ori.uzh.ch/links.html, clicking a link opens a new tab, and after closing that tab, you can move to the next link with the tabulator key. On that site, it still works with Firefox 5. I also worked on our project site (password secured, sorry) with Firefox up to 3.6.18. But now, if I open a link with the mouse, close that tab again and press the tab key, the focus just goes to the first clickable button, as if I had not clicked any button previously. If I open a link by tab key and "enter", the keyboard focus is preserved on that button. But there are many many buttons on our pages, and they reload frequently.
    BTW I adjusted the system preferences, so that the keyboard focus moves between all controls. (see http://www.tipstrs.com/tip/1505/Tab-key-to-select-form-elements-in-Firefox-on-the-Mac). But I don't think the problem is related to that.

    I found out that our buttons are no links, but input tags, type="submit". I'll discuss the problem with our programmer.

  • Bug Report: The keyboard focus doesn't automatical...

    Bug Report: When a conversation window opens, the focus doesn't automatically land in the chat entry text field.
    Since the new interface for Skype was introduced officially in Skype 7.0, there is a bug with the system/keyboard focus for a new conversation window. When Skype is in "Split Window View" and each new conversation automatically pops up in a separate window, the system/keyboard focus doesn't land in the chat entry edit field. Instead, the user has to press Shift+TAB a couple of times, to move it there and reply to the chat message received. This especially problematic for screen reader users, who rely on keyboard navigation. This mainly occurs when a new conversation is started with an incoming message, but it sometimes occurs when moving the focus out of that conversation window and later back in it again (while it is still opened).
    Steps to reproduce it:
    1. From "View" menu, activate the "Split Window View", if it is not already enabled.
    2. From Tools -> Options -> IM & SMS -> IM settings, enable "Open a new window when I receive a new message in Split Window View", if it is not already enabled.
    3. From Tools -> Options -> Advanced, activate "Enable accessible mode", if it is not already enabled.
    4. Activate the "Save" button, to save the changes.
    5. Close all windows, related to Skype. You may keep only the main window opened.
    6. Tell someone to send you a chat message. When the message arrives, Move the system focus to the conversation window in question, preferably with Alt+TAB. The system/keyboard will not land in the chat entry edit field as it did in Skype 6.21 and earlier and as it should by default, but in some unknown place in the window.
    7. Move the system/keyboard focus in the chat entry edit field and keep it there.
    8. Switch to another window, preferably from another application.
    9. With Alt+TAB, switch back to the window of the opened Skype conversation. There is a chance that the system/keyboard focus will not land in the chat entry edit field as it did in Skype 6.21 and earlier and as it should do by default, but again in some unknown place in the conversation window. But that is harder to reproduce.
    Test environment:
    - Operating system: Windows 8.1 Pro N, 64-bit, in Bulgarian with all locale settings set to "Bulgarian".
    - Skype version: 7.0.0.102 for Desktop.

    This is a known problem, but Skype have not given us an estimated time for a fix.
    Traditionally, Skype updates have been roughly monthly, so we are due a new version sometime soon. Many of us here are hoping that is has a bunch of fixes for the UI, the focus problem being one of them.
    Sean Ellis - uses Skype chat for serious work
    Click here to read my blog post on Skype 7 and basic principles of GUI design

  • Loss of keyboard focus in Java appl running under linux

    I have a small sample program that replicates my problem. When this program is run a window is created. If you select File->New another instance of the program window is created. Now if you try to go back and bring to front the first window, keyboard focus is not
    transferred when run under linux. You can only type in the second window. The expected behavior does happen in Windows.
    > uname -a
    Linux watson 2.6.20-1.2933.fc6 #1 SMP Mon Mar 19 11:38:26 EDT 2007 i686 i686 i386 GNU/Linux
    java -versionjava version "1.5.0_11"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
    Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
    javac -versionjavac 1.5.0_11
    import java.awt.event.*;
    import javax.swing.*;
    class SwingWindow extends JFrame {
        SwingWindow() {
         super("SwingWindow");
         JMenuBar menuBar = new JMenuBar();     
            JMenu fileMenu = new JMenu("File");
            JMenuItem newItem = new JMenuItem("New");
            newItem.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) {
              SwingWindow.createAndShowGUI();
         fileMenu.add(newItem);
            menuBar.add(fileMenu);
            setJMenuBar(menuBar);
            setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);       
         JTextField text = new JTextField(200);
         getContentPane().add(text);
         pack();
         setSize(700, 275);
        public static void createAndShowGUI() {
            JFrame frame = new SwingWindow();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    You can implement the FocusListener interface. When
    the first JFrame gains focus, call
    text.requestFocusInWindow(). I hope this helps.The call requestFocusInWindow is not helping, perhaps even making it worse.
    The problem seems to be that I am in the situation where the call
    KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner()
    is returning the expected Component. The problem is that the KeyListener class that is registered with the Component is not being called when a key is being pressed.
    The issue is that I have a component that has the keyboard focus, but the KeyListener class
    is not responding.
    This seems to be a linux only problem which makes it only mysterious.

  • JComboBox popup list remains open after losing keyboard focus

    Hi,
    I have noticed a strange JComboBox behavior. When you click on the drop down arrow to show the popup list, and then press the Tab key, the keyboard focus moves to the next focusable component, but the popup list remains visible.
    I have included a program that demonstrates the behavior. Run the program, click the drop down arrow, then press the Tab key. The cursor will move into the JTextField but the combo box's popup list is still visible.
    Does anyone know how I can change this???
    Thanks for any help or ideas.
    --Yeath
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class Test extends JFrame
       public Test()
          super( "Test Application" );
          this.getContentPane().setLayout( new BorderLayout() );
          Box box = Box.createHorizontalBox();
          this.getContentPane().add( box, BorderLayout.CENTER );
          Vector<String> vector = new Vector<String>();
          vector.add( "Item" );
          vector.add( "Another Item" );
          vector.add( "Yet Another Item" );
          JComboBox jcb = new JComboBox( vector );
          jcb.setEditable( true );
          JTextField jtf = new JTextField( 10 );
          box.add( jcb );
          box.add( jtf );
       public static void main( String[] args )
          Test test = new Test();
          test.pack();
          test.setVisible( true );
          test.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    }

    ran your code on 1.5.0_3, observed problem as stated.
    even though the cursor is merrily blinking in the textfield, you have to click into
    the textfield to dispose the dropdown
    ran your code on 1.4.2_08, no problems at all - tabbing into textfield immediately
    disposed the dropdown
    another example of 'usual' behaviour (involving focus) breaking between 1.4 and 1.5
    the problem is that any workaround now, may itself be broken in future versions

  • My MacBook Pro Retina's Bluetooth chipset unknown/odd login message on the login screen states Login Window Authentication Login window Name edit text has keyboard focus. In addition, the login screen is not remembering me

    I have been experiencing several issues with my MacBook Pro Retina mid 2012. My MBPR is scheduled to go into the depot. However, I am wondering if anyone may be able to shed light on a few issues as this is the third "official" time my MBPR is going back for service ("one depot" trip; "one authorized" dealer; several in-store visits).
    My Bluetooth is stating that the Bluetooth Chipset is Unknown (0). I also have had Bluetooth Preferences mysteriously change on me. In addition, while Bluetooth is off there are two serial modems turning on. I have turned them off, but they continue to pop up.
    In addition, when I log in, my MBPR is not remembering me and my login name is not appearing on the slate-gray screen. The name and password are blank and the following message appears in the lower left hand corner. "login window authentication login window Name edit text has keyboard focus."  As a side note, I am the only user. The login issue is a recent occurrence as we just totally wiped it again via a Command + R, and I don't believe I have an accessibility setting set to anything that would cause this, but wanted to check.
    Should I be concerned here? Has anyone else had issues like this? I don't want to worry if I don't have to. I have had so many issues over the course of nine months. 5-6 wipes. Airport card replaced and I am about to pull my hair out if my MBPR doesn't come back worldly like clock work this time. I just can't send my days trying to get a $2300 product to work for me any longer. No idea what is wrong with it, but it is driving me insane. Cross your fingers for me and any guidance you have or thoughts would be welcomed. Thank you. EMM

    A few more issues...
    In Console, the following is greyed out:
    User and Diagnostic reports
    Com.apple.launchd.peruser.0
    Com.apple.launchd.peruser.88
    Com.apple.launchd.peruser.89
    Com.apple.launchd.peruser.92
    Com.apple.launchd.peruser.97
    Com.apple.launchd.peruser.200
    Com.apple.launchd.peruser.201
    Com.apple.launchd.peruser.202
    Com.apple.launchd.peruser.212
    *[user logs are accessible]
    Krb5kdc
    Radius
    My guest files are locked, but again I am the administrator of MBPR.
    I am worried about a keystroke logged or at least, trying to rule it out.
    Also:
    Mdworker32(225) [and other mdworker numbers] are sandboxing; stating deny Mach-lookup
    Com.apple.Powermanagement.control, etc. long attachment with those files with version: ??? (???).
    Postinstall: removing applications/Microsoft Office 2011/Microsoft Outlook.app
    WARNINGS in Console include:
    [NSImage compositeToPoint:fromRect:operation:fraction:] is deprecated in MacOSX 19.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction] instead.
    There are a ton of other warnings. Before I go through this again, can someone tell me if this is normal (all of it -- above too); or if these are symptoms is a keystroke logger or hardware issues? 
    I ask because originally, when my computer went in for diagnostics (more than once), Apple stated the hardware was fine (other than Airport Card -- finally). However, if I've done 5-6 total wipes; created new users; do not have sharing set-up; have not played around in Terminal; and am up-to-date with versions -- and various issues KEEP COMING BACK -- I am left wondering if a keystroke logger would be possible here?!? I thought maybe a faulty logic board, but why would diagnostics be okay, then? Not trying to be hyperbole, just desperate.
    Please help me rule keystroke logger out or at least, tell me so I know, so I can take appropriate action. If you think it could be the logic board with symptoms above, that would be a great too.
    All I want to do is use the computer as intended, but I can't seem to get a real answer, so after nine months -- I am turning to the communities to see if anyone -- anyone at all -- can help. The last thing I can do is have the MBPR come back from the depot and the same thing occur. Any guidance or advice would be so gratefully appreciated.

Maybe you are looking for

  • IPhoto organization in iTunes? It IS supposed to be a LIBRARY you know.

    When are we going to see some kind of multiple library function in iTunes similar to the way iPhoto is set up with "Events" organizing the photos. Having one gigantic list of songs that is the only way of viewing your main library (no playlists don't

  • Flash player 9 and PNG

    Hi, i have a site that uses PNG that overlap. On some computers the transparency is showed in red both IE6 and Firefox and Opera 9.2.5 - Does anyone have any recommendations? or is there abug in Flash player? Regards Y

  • Smart playlist update

    Can anybody tell me how often you can expect smart playlists to update? is it possible to set so smart playlists update daily or weekly? Regards Greg

  • Server 2012 R2 - Remote Apps (RDWeb) and Self Signed Certificates!

    Hi all! I have been playing around with VM's on Microsoft Azure just to try and have some Windows Services facing externally that I can play around with and test. I have spun up a Windows Server 2012 R2 Server and installed Remote Desktop Services on

  • Authorization  -- Roles

    Hi All, We are moving our applicaiton from Oracle Forms to Apex. I am basically a forms developer and I didnt understand the authorization/roles in Apex. For eg in our database we have 2 roles app_lookup ( privs - insert,update, delete, select) and a