package elte.java2_utikalauz5.java2d; import java.awt.*; import java.awt.font.*; import java.awt.event.*; import java.awt.geom.*; /** peldaprogram uj betutipusok kezelesere. @link.forrásfájl {@docRoot}/../data/java2d/src UjBetutipus.java @link.letöltés {@docRoot}/../data/java2d UjBetutipus.jar @since Java 2 Útikalauz programozóknak */ class UjBetutipus extends Canvas { /** Verziószám */ private final static long serialVersionUID = 15L; public void paint (Graphics g) { Graphics2D g2 = (Graphics2D) g; AffineTransform trafo = AffineTransform.getRotateInstance (-Math.PI / 2, 0.0, 0.0); Font betutipus = new Font ("Times New Roman", Font.BOLD, 12); Font ujBetutipus = betutipus.deriveFont (trafo); g2.setFont (ujBetutipus); g2.drawString ("Ez egy fuggoleges szoveg!", 30.0f, 300.0f); } public static void main (String[] args) { Frame f = new Frame (); f.add (new UjBetutipus ()); f.addWindowListener ( new WindowAdapter () { public void windowClosing (WindowEvent e) { System.exit (0); } } ); f.setSize (100, 500); f.setVisible (true); } }