<Swing Dev> Review Request for Bug 8146320 JTextField ignores setPreferredSize when having columns
Alexander Scherbatiy
alexandr.scherbatiy at oracle.com
Tue Jan 19 15:09:06 UTC 2016
On 18/01/16 14:46, Prem Balakrishnan wrote:
>
> Hi,
>
> Please review fix for JDK9,
>
> *Bug:*https://bugs.openjdk.java.net/browse/JDK-8146320
>
> *Webrev:*http://cr.openjdk.java.net/~rchamyal/prem/8146320/webrev.00/
> <http://cr.openjdk.java.net/%7Erchamyal/prem/8146320/webrev.00/>
>
> *Issue:*
>
> JTextField ignores setPreferredSize when having columns
>
> *Cause:*
>
> JTextField setPreferredSize is not actually ignored , when column
> value is set>0.
>
> While retrieving the values set using getPreferredSize(), wrong values
> were returned.
>
> *Fix:*
>
> Check added, if Column>0 and if Preferred size is not set after
> setting columns, while retrieving values.
>
The javadoc for the JTextField.getPreferredSize() method should be
updated according to the fix:
/**
* Returns the preferred size <code>Dimensions</code> needed for this
* <code>TextField</code>. If a non-zero number of columns has been
* set, the width is set to the columns multiplied by
* the column width.
...
*/
Thanks,
Alexandr.
>
> Regards,
> Prem
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20160119/baaa254a/attachment.html>
More information about the swing-dev
mailing list