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

Placeholder alignment #721

Closed
pablotecheraa opened this issue Aug 27, 2023 · 2 comments
Closed

Placeholder alignment #721

pablotecheraa opened this issue Aug 27, 2023 · 2 comments
Milestone

Comments

@pablotecheraa
Copy link

The JTextField component supports the client property "JTextField.placeholderText", which takes as default alignment "ComponentOrientation.LEFT_TO_RIGHT". I propose that if you set a different alignment for the text using "setHorizontalAlignment(SwingConstants.CENTER)" the "placeholder" text should be aligned in that direction as well.

Since the placeholder text uses "ComponentOrientation" it is not possible to align it to the center when using "setHorizontalAlignment".

1
2
3

When "setHorizontalAlignment.CENTER" is not defined use "LEFT_TO_RIGHT" or "RIGHT_TO_LEFT".

DevCharly added a commit that referenced this issue Aug 27, 2023
…izontal alignment property of `JTextField` (issue #721)
@DevCharly
Copy link
Collaborator

Thanks for reporting. 👍

fixed in latest 3.3-SNAPSHOT: https://github.com/JFormDesigner/FlatLaf#snapshots

Placeholder now respects horizontal alignment property:

grafik

And for right-to-left component orientation:

grafik

@DevCharly DevCharly added this to the 3.3 milestone Aug 27, 2023
@DevCharly
Copy link
Collaborator

fixed in FlatLaf 3.2.1

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

2 participants