Hullo all- While Im at it, here is another problem:<br>What I want is a JLabel with the text rotated pi/2 anti-clockwise. I took a shot at the problem but no matter how I try to tackle it, I find myself either with a NullPointerException or some other problem.<br><br>Can someone help me?<br><br>/Fimblo<br><br>Here is the code as of now.<br><br><br>import javax.swing.*;<br>import java.awt.*;<br>import java.awt.image.*;<br><br>public class RotatedLabel extends JLabel {<br> public static Canvas canvas = new Canvas();<br> public RotatedLabel(String name) {<br> super();<br> setIcon(createImage(name));<br> }<br> <br> private ImageIcon createImage(String name) {<br> ImageIcon icon = new ImageIcon();<br> Image i = icon.getImage();<br> Graphics2D g = (Graphics2D) icon.getGraphics();<br> g.rotate((-0.5)*Math.PI, 50, 50); <br> g.drawString(name, 50, 50);<br> return icon;<br> }<br> <br> public static void main(String[] in) {<br> JFrame world = new JFrame("test"<br> Container cp = world.getContentPane();<br> cp.setLayout(new BoxLayout(cp, BoxLayout.X_AXIS));<br> cp.add(new RotatedLabel("one");<br> cp.add(new RotatedLabel("two");<br> world.pack();<br> world.setVisible(true);<br> } <br>}<br>