<Swing Dev> RFR: [JDK-8025082] The behaviour of the highlight will be lost after clicking the set button

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Tue Aug 25 08:57:45 UTC 2015


On 8/21/2015 3:10 PM, Rajeev Chamyal wrote:
> Hi,
>
> Please review the following fix for jdk9:
>   
> Bug:https://bugs.openjdk.java.net/browse/JDK-8025082
>
> webrev: 
> http://cr.openjdk.java.net/~psadhukhan/rajeev/8025082/webrev.00/ 
> <http://cr.openjdk.java.net/%7Epsadhukhan/rajeev/8025082/webrev.00/>
>
>   
> The highlight of selected text in JTextPane/JTextArea is lost if some other component (e.g. button clicked) gains focus.
> Added a method to update the selection ownership for caret when text is selected/unselected in the JTextPane/JTextArea.

    - The updateOwnsSelection() method can be shorter if use the 
conditional operator '?'
https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.25
    - SwingUtilities.invokeAndWait() should be used instead of 
invokeLater. In other case the system can suspend the EDT thread and 
robot will start its actions before the createUI() execution.
    - button.getLocationOnScreen() should be called on EDT in the test
   - The actionPerformed() method is not properly formatted
   - What is the reason to use double colons in the error messages?
    - System.out.println calls are not really necessary for the 
automated test. It also pollute the logs for SQE team when all tests are 
running. The only exception throwing can be left in the 
actionPerformed() method.
    - line 30  '* **/' - small formatting issue

   Thanks,
   Alexandr.

>   
> Regards,
> Rajeev Chamyal
>   
>




More information about the swing-dev mailing list