<Swing Dev> Unexpected NullPointerException by endComposition()

Pavel Porvatov pavel.porvatov at oracle.com
Wed Sep 21 14:47:00 UTC 2011


Hi Charles,
> Hi guys,
>
> This issue is related about sunbug 6938583. 
> (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6938583)
>
> I am thinking maybe it can be fixed in the CodePointIM code. The 
> problem is occurred when the IM is in the compose mode and use left 
> click the Mouse. Maybe we can consume the left click the event when it 
> is in the compose mode?
>
> The code looks like:
>
> if (!notInCompositionMode && (event instanceof MouseEvent)) {
>     MouseEvent mEvent = (MouseEvent)event;
>     if (mEvent.getID() == MouseEvent.MOUSE_CLICKED && 
> mEvent.getButton() == MouseEvent.BUTTON3) {
>         mEvent.consume();
>     }
>     return;
> }
>
> in the dispatchEvent of CodePointInputMethod.
>
Could you please send webrev of your fix? Why did you write "consume the 
left click" but used "mEvent.getButton() == MouseEvent.BUTTON3"? Can you 
explain why should we consume left clicks but not right ones (or vice 
versa)?

Thanks, Pavel




More information about the swing-dev mailing list