W
willy
Hello,
First, I apologized for my bad english (I'm French ... )
Currently, I develop a Java software
And I have some problems with focus in Java:
I have a main JFrame and JPanel which are overlayed
In each JPanel, I have different JTextField.
I have a function that will give focus to a JTextField:
public static void myRequestFocusInWindow (final JTextField
field) (
SwingUtilities.invokeLater (new Runnable () (
public void run () (
field.requestFocusInWindow ();
)
));
)
But I noticed that when I was only 2 (or less) JPanel overlayed
the focus is correctly given.
but for more than 3 JPanel, the focus remains on the JTextField of the
2nd JPanel
which means that the focus is not given.
Unfortunately, I can not do without these JPanel
Therefore, I would like to know how to solve this.
I am afraid that we can not stack calls of SwingUtilities.invokeLater.
Please help me.
Thank you
First, I apologized for my bad english (I'm French ... )
Currently, I develop a Java software
And I have some problems with focus in Java:
I have a main JFrame and JPanel which are overlayed
In each JPanel, I have different JTextField.
I have a function that will give focus to a JTextField:
public static void myRequestFocusInWindow (final JTextField
field) (
SwingUtilities.invokeLater (new Runnable () (
public void run () (
field.requestFocusInWindow ();
)
));
)
But I noticed that when I was only 2 (or less) JPanel overlayed
the focus is correctly given.
but for more than 3 JPanel, the focus remains on the JTextField of the
2nd JPanel
which means that the focus is not given.
Unfortunately, I can not do without these JPanel
Therefore, I would like to know how to solve this.
I am afraid that we can not stack calls of SwingUtilities.invokeLater.
Please help me.
Thank you