public void mouseReleased(MouseEvent e) { if (m_dragging && m_gc != null) { if (m_comp_size > 0) { int col = m_gc.getColumn() + m_gc.getColumnSpan() - 1; GridView view = m_gc.getParentView(); ColumnSpec oldspec = view.getColumnSpec(col); FormEditor editor = FormEditor.getEditor(view); if (editor != null) { NewSizeAdapter adapter = new NewSizeAdapter(oldspec, m_comp_size, m_units); if (!adapter.isResizeGrow() && !adapter.isBoundedSize()) { String newspec = FormUtils.toEncodedString(adapter); EditColumnSpecCommand cmd = new EditColumnSpecCommand( view.getParentForm(), col, new ColumnSpec(newspec), oldspec); CommandUtils.invoke(cmd, editor); } else { String msg = null; if (adapter.isBoundedSize()) { msg = I18N.getLocalizedMessage( "The column size is set to bounded.\nYou must manually set the size in the column specification window."); } else if (adapter.isResizeGrow()) { msg = I18N.getLocalizedMessage( "The column resize behavior is set to grow.\nYou must manually set the size in the column specification window."); } else { msg = I18N.getLocalizedMessage( "You must manually set the size in the column specification window."); } String title = I18N.getLocalizedMessage("Error"); JOptionPane.showMessageDialog(m_view, msg, title, JOptionPane.ERROR_MESSAGE); } } else { assert (false); } } javax.swing.SwingUtilities.invokeLater( new Runnable() { public void run() { m_overlay.setResizeIndicator(null); m_overlay.repaint(); m_dragging = false; update(m_gc); } }); } }