DropMode (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../java.base/java/io/Serializable.html "interface in java.io"), [Comparable](../../../java.base/java/lang/Comparable.html "interface in java.lang")<[DropMode](DropMode.html "enum in javax.swing")>, [Constable](../../../java.base/java/lang/constant/Constable.html "interface in java.lang.constant")


public enum DropMode extends Enum<DropMode>

Drop modes, used to determine the method by which a component tracks and indicates a drop location during drag and drop.

Since:

1.6

See Also:

JTable.setDropMode(javax.swing.DropMode), JList.setDropMode(javax.swing.DropMode), JTree.setDropMode(javax.swing.DropMode), JTextComponent.setDropMode(javax.swing.DropMode)

Enum Constants

Enum Constant Description
INSERT The drop location should be tracked in terms of the position where new data should be inserted.
INSERT_COLS The drop location should be tracked in terms of the column index where new columns should be inserted to accommodate the dropped data.
INSERT_ROWS The drop location should be tracked in terms of the row index where new rows should be inserted to accommodate the dropped data.
ON The drop location should be tracked in terms of the index of existing items.
ON_OR_INSERT This mode is a combination of ON and INSERT, specifying that data can be dropped on existing items, or in insert locations as specified by INSERT.
ON_OR_INSERT_COLS This mode is a combination of ON and INSERT_COLS, specifying that data can be dropped on existing items, or as insert columns as specified by INSERT_COLS.
ON_OR_INSERT_ROWS This mode is a combination of ON and INSERT_ROWS, specifying that data can be dropped on existing items, or as insert rows as specified by INSERT_ROWS.
USE_SELECTION A component's own internal selection mechanism (or caret for text components) should be used to track the drop location.
Modifier and Type Method Description
static DropMode valueOf​(String name) Returns the enum constant of this type with the specified name.
static DropMode[] values() Returns an array containing the constants of this enum type, in the order they are declared.

Methods declared in class java.lang.Enum

[clone](../../../java.base/java/lang/Enum.html#clone%28%29), [compareTo](../../../java.base/java/lang/Enum.html#compareTo%28E%29), [describeConstable](../../../java.base/java/lang/Enum.html#describeConstable%28%29), [equals](../../../java.base/java/lang/Enum.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Enum.html#finalize%28%29), [getDeclaringClass](../../../java.base/java/lang/Enum.html#getDeclaringClass%28%29), [hashCode](../../../java.base/java/lang/Enum.html#hashCode%28%29), [name](../../../java.base/java/lang/Enum.html#name%28%29), [ordinal](../../../java.base/java/lang/Enum.html#ordinal%28%29), [toString](../../../java.base/java/lang/Enum.html#toString%28%29), [valueOf](../../../java.base/java/lang/Enum.html#valueOf%28java.lang.Class,java.lang.String%29)