Results 1 to 4 of 4
  1. #1
    Dipke is offline Member
    Join Date
    Aug 2010
    Location
    Leuven, Belgium
    Posts
    86
    Rep Power
    0

    Default Scale to the left

    Hi,
    I want ti put a scale in a Jpanel on the left of a graph.
    I put this in the West part of a BorderLayout.

    But when i use g.drawString("text") the width of the NorthPanel is too small.
    When i use Labels the width is OK but the vertical positioning is not correct.

    How can i set the width of a panel with just g.drawstrings on it ?

    Kind regards

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: Scale to the left

    How can i set the width of a panel with just g.drawstrings on it ?
    Why try to reinvent JLabel?

    When i use Labels the width is OK but the vertical positioning is not correct.
    Have you gone through the API for JLabel to find what methods might help you get the alignment your want?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Dipke is offline Member
    Join Date
    Aug 2010
    Location
    Leuven, Belgium
    Posts
    86
    Rep Power
    0

    Default Re: Scale to the left

    Hi,

    By vertical positioning i do not mean the left indent or right indent.

    Grz

  4. #4
    Dipke is offline Member
    Join Date
    Aug 2010
    Location
    Leuven, Belgium
    Posts
    86
    Rep Power
    0

    Default Re: Scale to the left

    hi,

    I was using verticaltextposition instead of verticalalignment.

    My mistake.

    thx

Similar Threads

  1. Reversing dojo slider to make it slide from right to left rather left to right as giv
    By gurpreet.singh in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 05-05-2011, 01:49 PM
  2. square moves left and down but not up or left
    By natdizzle in forum AWT / Swing
    Replies: 3
    Last Post: 02-04-2011, 05:20 PM
  3. how to scale correctly ?
    By h9h in forum Java 2D
    Replies: 10
    Last Post: 10-29-2009, 07:06 AM
  4. How to use Scale in SWT
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-07-2008, 04:49 PM
  5. Transform Scale
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-21-2008, 08:53 PM

Posting Permissions

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