Search code examples
javaswingmouseeventjtextpane

How to drag more than one JTextPane


I have created a frame with null layout, and I have 6 small JTextPanes in it. My intention is when I clicked a particular textpane, it has to get dragged by mouse wherever I want in the frame.


Solution

  • As an alternative to null layout, consider six instances of JInternalFrame, each containing a JTextPane. An enclosing JDesktopPane derives from JLayeredPane, which manages its null layout implicitly.