如果Frame中有個表格JTable,且允許雙擊單元格編輯,那麼可能在編輯中移動Frame時出現單元格偏移,可用下面的方法解決
this.setDragEnabled(true);
this.addEventListener(DragAndDropEvent.DRAG_RECOGNIZED, __onDragRecognized, false, 0, true);
/** 防止移動Frame時正在編輯的單元格移位(焦點問題) */
private function __onDragRecognized(event:DragAndDropEvent):void{
if(_paramTablePanel.table.getCellEditor() != null){
_paramTablePanel.table.getCellEditor().stopCellEditing();
}
}