Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 10785 - AWT/SWT - GUI Components cannot receive keyboard focus
Summary: AWT/SWT - GUI Components cannot receive keyboard focus
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 37724
  Show dependency tree
 
Reported: 2002-03-05 11:16 EST by Dirk Wenke CLA
Modified: 2004-02-13 00:57 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wenke CLA 2002-03-05 11:16:39 EST
This problem occurs since I switched from jdk1.3.1 to jdk1.4 (version 1.4.0-
rc). The problem occures when I run the main-method in the eclipse environment. 
It also occurs if I start from a console window while eclipse is running in the 
background. It only works properly if I shut down the eclipse environment and 
start from the console.

A short description of the example application :
I have a small JFrame with a JTextField and a JComboBox in it. I can
write into the textfield, but after I select something from
the combobox, I can edit the textfield no more. If I popup another
window in front of my frame and than return to my frame, I am able to
write again into the textfield.

Here is the code of the JFrame :


package test;

import javax.swing.*;
import java.awt.BorderLayout;

public class TestFrame2 extends JFrame {
	public TestFrame2() {
		super("TestFrame");
		setSize(200,200);
		getContentPane().setLayout(new BorderLayout());
		JComboBox comboBox = new JComboBox();
		getContentPane().add(comboBox, "South");
		comboBox.addItem("Test1");
		comboBox.addItem("Test2");
		JTextField tf = new JTextField();
		getContentPane().add(tf, "North");
	}

	public static void main(String[] args) {
		TestFrame2 frame = new TestFrame2();
		frame.addWindowListener(new java.awt.event.WindowAdapter() {
			public void windowClosed(java.awt.event.WindowEvent e) {
				System.exit(0);
			};
		}); frame.setVisible(true);
	}
}

Best regards

Dirk
Comment 1 Erich Gamma CLA 2002-03-07 05:39:06 EST
moving to SWT since it keyboard focus related.
Comment 2 Mike Wilson CLA 2002-03-07 08:54:55 EST
Note switch in jdk from 1.3 to 1.4; SQ to investigate.
Comment 3 Silenio Quarti CLA 2004-02-13 00:57:28 EST
I am not sure how this is related to SWT. There is only AWT code running in 
the testcase. Anyway, this bug is really old and I haven't been able to 
reproduce it. Please reopen if you are able to reproduce it.