import javax.swing.JTextArea; import javax.swing.text.JTextComponent; public class Main { public static void main(String[] argv) throws Exception { JTextComponent textComp = new JTextArea(); textComp.setDragEnabled(true); } }