I have created a frame with null
layout, and I have 6 small JTextPane
s in it. My intention is when I clicked a particular textpane
, it has to get dragged by mouse wherever I want in the frame.
Asked
Active
Viewed 72 times
-1
-
1You should try something before coming here... Questions should be more specific. – acdcjunior May 18 '13 at 05:14
-
That oesnt make sense, what you mean by high liter and dragged? – MadProgrammer May 18 '13 at 05:31
-
i want a particular textpane to be dragged when clicked by mouse in java. what i want exactly is how to know a particular text pane is clicked so that i able to drag by using mouse using mouse listener events in java making remaining textpanes fixed – Ananth May 18 '13 at 09:13
-
@AnanthBommakanty you should post an SSCCE to show what you tried – An SO User May 18 '13 at 09:18
-
k i had 6 labels in my jframe. now if i select a label it have to be dragged when i drag it by mouse remaining labels making unchanged. – Ananth May 18 '13 at 10:25
-
See also this [Q&A](http://stackoverflow.com/q/9554636/230513). – trashgod May 19 '13 at 13:42
1 Answers
3
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.

trashgod
- 203,806
- 29
- 246
- 1,045