Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JTextField select complete text on focus #983

Open
Rdiger-36 opened this issue Mar 12, 2025 · 0 comments
Open

JTextField select complete text on focus #983

Rdiger-36 opened this issue Mar 12, 2025 · 0 comments

Comments

@Rdiger-36
Copy link

Hi,
I'm not sure if it's my mistake or how I use it, but when I load my GUI application and set the JFrame visible, I want to focus a JTextField. This text field contains a prefix of 7 characters. When the frame becomes visible and I set focus to the text field, I want the caret to be positioned right after the prefix.
This works fine with all other Look and Feels, but not with FlatLaf themes.

My Code:

JTextFiled txt = new JTextField("PCTEST-");
txt.setCarretPosition(7);

I am limited by Java 8 (build 1.8.0_432-b06).
OS: Windows 11 23H2
FlatLaf Version 3.5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant