-
Enhancement
-
Resolution: Fixed
-
P4
-
1.4.0, 1.4.2, 5.0, 5.0u3, 5.0u6
-
b42
-
generic, x86, sparc
-
generic, linux, solaris_9, windows_nt, windows_2000
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2128894 | 5.0u6 | Shannon Hickey | P2 | Closed | Won't Fix |
This causes many complications. With text, playing with the caret causes the selection to be temporary lost as described in the report below. With the other components, using the selection makes it difficult to specify a drop above or below the current selection.
A new mechanism should be designed such that a drop location can be displayed without using the selection.
-----------------------------------
Original bug report:
Name: bsC130419 Date: 06/11/2001
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
Dragging selected text from a text component deselects the original text. The
original text is deselected as soon as the drag starts. I expect the original
text to remain selected until the text is dropped on a target.
Set setDragEnabled on a JTextField, JTextArea, JTextPane, JFormattedTextField
or JEditorPane to true to select default drag operation. After selecting some
text and starting to drag, the text becomes unselected.
The example code shows a frame with each of the text components in it. The
components have had their default drag operation enabled so that drag and drop
of text can by played with. Select some text in any component and drag it. As
soon as the selected text is dragged the original text becomes unselected.
/*
* Test.java
*
* Created on 6 June 2001, 16:08
*/
/**
*
* @author daz
* @version 1.0
*/
public class Test extends javax.swing.JFrame {
/** Creates new form Test */
public Test() {
initComponents ();
jFormattedTextField1 = new javax.swing.JFormattedTextField();
jFormattedTextField1.setText("jFormattedTextField1");
getContentPane().add(jFormattedTextField1);
jTextArea1.setDragEnabled(true);
jTextField1.setDragEnabled(true);
jTextPane1.setDragEnabled(true);
jEditorPane1.setDragEnabled(true);
jFormattedTextField1.setDragEnabled(true);
pack ();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
jTextArea1 = new javax.swing.JTextArea();
jTextField1 = new javax.swing.JTextField();
jTextPane1 = new javax.swing.JTextPane();
jEditorPane1 = new javax.swing.JEditorPane();
getContentPane().setLayout(new java.awt.GridLayout(0, 1));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
});
jTextArea1.setText("jTextArea1");
getContentPane().add(jTextArea1);
jTextField1.setText("jTextField1");
getContentPane().add(jTextField1);
jTextPane1.setText("jTextPanel1");
getContentPane().add(jTextPane1);
jEditorPane1.setText("jEditorPane1");
getContentPane().add(jEditorPane1);
}//GEN-END:initComponents
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {//GEN-
FIRST:event_exitForm
System.exit (0);
}//GEN-LAST:event_exitForm
/**
* @param args the command line arguments
*/
public static void main (String args[]) {
new Test ().show ();
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextPane jTextPane1;
private javax.swing.JEditorPane jEditorPane1;
// End of variables declaration//GEN-END:variables
private javax.swing.JFormattedTextField jFormattedTextField1;
}
(Review ID: 126245)
======================================================================
- backported by
-
JDK-2128894 Swing DnD should not use selection to show drop location
- Closed
- duplicates
-
JDK-6310757 NPE drag-n-drop a swing JTree node (from a JPanel) onto an empty JPanel
- Closed
-
JDK-4760426 JTree DnD conflicts with JTree.setUI(..)
- Closed
-
JDK-5077753 GTK L&F Drag & Drop (DND) feedback inconsistent with actual GTK
- Closed
-
JDK-2119909 JTree DnD conflicts with JTree.setUI(..)
- Closed
-
JDK-6184817 Make BasicDropTargetListener public
- Closed
-
JDK-6184866 BasicTreeUI should use factory method to construct drop target listener
- Closed
-
JDK-6342398 More flexibility in specifying drag over changes to a component
- Closed
- relates to
-
JDK-6315298 Swing DnD - Cannot insert into empty tree folder.
- Resolved
-
JDK-6331837 Two Swing DnD methods - rename one and remove another
- Resolved
-
JDK-6277499 Minor API changes to support new Swing DnD API
- Resolved
-
JDK-6459915 DefaultTableCellRenderer.getTableCellRendererComponent() throws unexpected NPE
- Closed
-
JDK-4942851 canImport should carry Transferable in TransferHandler
- Resolved