JDK-8144763 : JOptionPane freeze if called from drop(..) of DropTargetListener
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8u66
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: other
  • CPU: x86
  • Submitted: 2015-10-22
  • Updated: 2016-09-20
  • Resolved: 2016-01-12
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

PS:  no freeze till idk8-51, freeze since jdk8-60

ADDITIONAL OS VERSION INFORMATION :
tested on OS X 10.11, 10.10.5, 10.9 --freeze,
tested on OS X 10.8 -- not freeze but flip.

A DESCRIPTION OF THE PROBLEM :

I made simple demo code below for you, compile it, run either inside Eclipse or exported jar, then drag some file on the pane, then it will show a JOptionPane, then freeze.... 
Freeze on OS X 10.11 El Capitan, 10.10.5, and 10.9. No freeze on 10.8 but flip.  no freeze till jdk8-51, freeze since jdk8-60


import java.awt.Dimension;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextPane;


public class DropFreezeDemo {
	public static JFrame frame = null;
	
	public static void main(String[] args){
		frame = new JFrame("Drop Freeze Demo");
		JTextPane jtp = new JTextPane();
	    DnDListener dndListener = new DnDListener();
	    new DropTarget(jtp, dndListener);
		frame.getContentPane().add(jtp);
		frame.setPreferredSize(new Dimension(300, 200));
		frame.setMinimumSize(new Dimension(300, 200));
		frame.pack();
		frame.setVisible(true);		
	}	
}

class DnDListener implements DropTargetListener {

	@Override
	public void drop(DropTargetDropEvent event) {
		JOptionPane.showMessageDialog(DropFreezeDemo.frame, "Now freeze!", "DropFreezeMessage", JOptionPane.ERROR_MESSAGE);							
	}

	@Override
	public void dragEnter(DropTargetDragEvent event) {}

	@Override
	public void dragExit(DropTargetEvent event) {}

	@Override
	public void dragOver(DropTargetDragEvent event) {}

	@Override
	public void dropActionChanged(DropTargetDragEvent event) {}

}




REGRESSION.  Last worked in version 8u66


REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Possibly duplicate of JDK-8134917
07-12-2015

Has a test case
04-12-2015