jcamilodo / seaglass

Automatically exported from code.google.com/p/seaglass
0 stars 0 forks source link

Placeholder text in search fields not clipped correctly #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
JTextField tf = new JTextField(10);
tf.putClientProperty("JTextField.variant", "search");
tf.putClientProperty("JTextField.Search.PlaceholderText", "Very long text
that XXXXXXXXXX");

What is the expected output? What do you see instead?
The placeholder text is painted over the bounds of the round search field
border. Text should be truncated in this mode inside of the round field
borders.

Original issue reported on code.google.com by rosstaus...@googlemail.com on 12 Mar 2010 at 8:09

GoogleCodeExporter commented 9 years ago
By golly, you're right! I'll get on it.

Original comment by kahuxtable on 12 Mar 2010 at 9:32

GoogleCodeExporter commented 9 years ago
Fixed in r1404.

Note that I'm using SwingUtilities2.clipStringIfNecessary, which replaces the 
end of the 
text with "..." if it's too long. This will remove more of the placeholder text 
than needed, 
but the text should be made to fit...

Original comment by kahuxtable on 12 Mar 2010 at 10:08