1. Prevent FocusEvents when Component is not focused stackoverflow.comI have the following sample-code:
|
2. FocusEvent help...... coderanch.com |
3. FocusEvent coderanch.com |
4. regarding FocusEvent coderanch.comimport java.awt.*; import java.awt.event.*; import javax.swing.*; class Testing extends JFrame { JTabbedPane tp = new JTabbedPane(); JTextField tf1 = new JTextField(10); JTextField tf2 = new JTextField(10); public Testing() { setLocation(300,200); setDefaultCloseOperation(EXIT_ON_CLOSE); tp.addTab("Tab1",new JPanel()); JPanel nextPanel = new JPanel(new GridLayout(2,1)); nextPanel.add(tf1); nextPanel.add(tf2); tp.addTab("Tab2",nextPanel); getContentPane().add(tp,BorderLayout.CENTER); JPanel bottom = new JPanel(); JButton btn = new JButton("Next"); bottom.add(btn); getContentPane().add(bottom,BorderLayout.SOUTH); pack(); btn.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ... |