Announcement

Collapse
No announcement yet.

JLabel hochkant

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • JLabel hochkant

    Hi Leute,
    ich frage mich, ob es möglich ist ein JLabel hochkant auf dem JFrame abzubilden.

    Mfg
    matczek

  • #2
    hi,

    etwas zum experimentieren.

    <PRE>
    public class VLable extends JLabel
    {
    public VLable( String aText )
    {
    super( aText );
    }

    public void paint( Graphics g )
    {
    AffineTransform at = new AffineTransform();
    Graphics2D g2D = ( Graphics2D ) g;

    at.setToTranslation( 0.0, 0.0 );
    g2D.transform( at );
    at.setToRotation( Math.PI / 2.0 );
    g2D.transform( at );
    g2D.drawString( getText(), 0, 0 );
    }
    }
    </PRE>

    MfG Konra

    Comment

    Working...
    X