JComponent « Focus « Java Swing Q&A





1. How to keep the highlight border of a JComponent, when custom border is set    stackoverflow.com

I have a JTextField, where I've set some custom properties:

nameField.setPreferredSize(new Dimension(275,40));
nameField.setBackground(bgColor);
nameField.setForeground(txtColor);
nameField.setFont(new Font("HelveticaNeue",Font.PLAIN,22));
nameField.setBorder(BorderFactory.createLineBorder(Color.WHITE, 2));
When the component has focus, there is no highlight shown around the field. On a Mac, it is usually ...

2. In which situation does a JComponent request to get focus? How to know which component is actually the focus owner?    stackoverflow.com

I have a bug in my application that i'm not able to find. I have some selectable and resizable JPanel , which display a border when selected. For some of them ...

3. Preventing focus during visual component construction in Java    stackoverflow.com

I have created an application which requires the reloading of an image several times throughout the program execution. Perhaps it's clumsy, but my implementation was to extend the Component class in ...