<Swing Dev> [12] RFR JDK-8212735:Compilation issue with javax.swing.InputVerifier example in javadoc section

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Wed Oct 24 22:30:52 UTC 2018


Looks fine.

On 23/10/2018 07:45, Prasanta Sadhukhan wrote:
> Hi All,
> 
> In https://download.java.net/java/early_access/jdk12/docs/api/java.desktop/javax/swing/InputVerifier.htmljavadoc, the example given does not compile as the "field" variable is not declared.
> Following fix ensures proper variable is used. Checked the example works after this.
> 
> --- a/src/java.desktop/share/classes/javax/swing/InputVerifier.java Tue Sep 18 18:32:03 2018 -0700
> +++ b/src/java.desktop/share/classes/javax/swing/InputVerifier.java Tue Oct 23 20:11:19 2018 +0530
> @@ -69,7 +69,7 @@
>    *         getContentPane().add(field1, BorderLayout.NORTH);
>    *         getContentPane().add(field2, BorderLayout.SOUTH);
>    *
> - *         field.setInputVerifier(new InputVerifier() {
> + *         field1.setInputVerifier(new InputVerifier() {
>    *             public boolean verify(JComponent input) {
>    *                return "pass".equals(((JTextField) input).getText());
>    *             }
> 
> Regards
> Prasanta


-- 
Best regards, Sergey.


More information about the swing-dev mailing list