-1

I recently worked on the MS PowerPoint 2007 and I got interested in rotation option of the text in the presentation Window .

Now I have created a JTextArea with some text in it.

Now what I want is I want to rotate the JTextArea by mouse (similar in MS PowerPoint 2007)

But I got no Idea of how to start .

Thanks in advance

  • write what have you tried and where you are facing problem exactly. – Rais Alam Jul 08 '13 at 04:45
  • @Rais Alam I want to know how to rotate the JTextarea in the mouse direction how to do that – Learning Java Jul 08 '13 at 04:57
  • 1
    It's not that it isn't possible, it's just hard to find the right example. Check out [this](http://stackoverflow.com/questions/14324460/rotating-a-jtextfield-vertically/14328881#14328881) which uses JXLayer – MadProgrammer Jul 08 '13 at 05:05
  • 1
    Please note that this is not a "please send me the code" site. You may want to show what you accomplished so far, how you are going to do the rotation and what problems you ran into. – Howard Jul 08 '13 at 05:06

1 Answers1

2

If you just don't know how to start, here is a hint:

  • implement a MouseMotionListener to track the MousePosition
  • to rotate components you can override their paintComponent(Graphics g) method and rotate with ((Graphics2D)g).rotate(degreeInRadians). Keep in mind that this probably crops your components.
MyPasswordIsLasercats
  • 1,610
  • 15
  • 24