Havin issues with a Java Application. I have a lot of textFields that update a string when they lose focus. The problem is, to make them lose focus, I have to click in another component, I'm not managing to make the contentPane itself being "clickable". Right now, I've tried "contentaPane.setFocusable(true)" and "contentPane.requestFocus()".
It's getting really annoying. Does anyone have an insight to help me out in this?
There it is a piece of the code. As it has a few thousand lines, I'll just paste the part concerning to the pane in question:
contentPane = new JPanel();
contentPane.setFocusable(true);
contentPane.setRequestFocusEnabled(true);
contentPane.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
}
});
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);