You are here:

Java/Skew and Bend JLabel in Swing


Hello Sir,

I checked your link and it was very helpful for rotating JLabel in swing.

By this link I got Idea, But here one problem for me.
Is there any way to add skew and bend(separately) feature into this file. So we just call the method like rotate the jlabel (rjl.setRotation(30);) likewise,
I am very confused to how to implement that both functionality with same class.

Can you help me for this?
Give me some more idea...


First, I didn't answer that question, it was someone else that answers questions here.

You can shear/scale/rotate pretty easily, but bending is more difficult. For that you will need to use the Java Advanced Imaging library.

To use the RotatedJLabel class simply add it as a component in a swing enviroment, and use the setRotation to change it.

Note that the class is probably more than you need. If you just want to draw a rotated string you can use font.deriveFont(0, tx) where tx is your AffineTransform.


g.setFont(g.getFont().deriveFont(0, AffineTransform.getRotateInstane(Math.PI/2));
g.drawString("String", 50, 50);


All Answers

Answers by Expert:

Ask Experts


Artemus Harper


I have a Masters in computer science. I can answer questions on core J2SE, swing and graphics. Please no questions about JSP or J2ME.


I have experience in Core Java, good background in Java swing/gui, some experience with JNI, Java reflection. Some experience in bio-informatics. Basics in c++ and c#

Washington State University

MS in Computer Science from Washington State University and a BS in Mathematics and Computer Science from Central Washington University.

©2017 All rights reserved.