Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By gimbal2

Thread: Rotating jPanel

  1. #1
    AnandVijay is offline Member
    Join Date
    Oct 2013
    Posts
    15
    Rep Power
    0

    Red face Rotating jPanel

    Hi Friends !

    Is there any way to Rotate jPanel in java (without using Paint Function)
    Like degrees(0,90,180,270)

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,049
    Rep Power
    6

    Default Re: Rotating jPanel

    Think of it like this: what use would it be to build such a feature in the standard API? Can you name even one common use for it? I can't think of any. If a rotation is required, generally that is the entire screen and not only one panel. But should you need it in a rare case, you can do it by overriding paintComponent().

    Why do -you- need this? And why the limitation of not doing it in the painting logic? It is a good idea to always provide context for your question; in other words explain why you need it because that makes it harder to misunderstand what you are asking. Is this an interview question? Homework? Do you need it for an application you're building?
    AnandVijay likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default Re: Rotating jPanel

    This question reminds me of one of Camickr's splendid tips: Vertical Label UI « Java Tips Weblog I don't know why one would want to rotate an entire JPanel though ... wouldn't it be easier to rotate your screen instead?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    AnandVijay is offline Member
    Join Date
    Oct 2013
    Posts
    15
    Rep Power
    0

    Default Re: Rotating jPanel

    i need this for my Application....
    & thanks for your replies gimbal and JosAH

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,049
    Rep Power
    6

    Default Re: Rotating jPanel

    Quote Originally Posted by AnandVijay View Post
    i need this for my Application....
    I guess I'm stupid that I didn't immediately ask "for what specific purpose".
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. rotating image
    By faraa in forum New To Java
    Replies: 1
    Last Post: 05-28-2013, 07:33 PM
  2. JPanel image rotating function
    By anoorally in forum Java 2D
    Replies: 2
    Last Post: 01-07-2012, 10:17 AM
  3. Help with Image Rotating?
    By Leospaceman in forum Java 2D
    Replies: 2
    Last Post: 05-31-2011, 02:48 PM
  4. Rotating Image?
    By sciguy77 in forum Java Applets
    Replies: 9
    Last Post: 02-17-2009, 01:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •