×

Discussion Board

Results 1 to 4 of 4

Thread: g.drawString()

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    33

    g.drawString()

    hi folks

    in my paint(Graphics g){} method im using

    g.drawString(QStr,10,11,g.TOP|g.LEFT);

    where, QStr = "Who measured in as the tallest and second-heaviest player ever taken with the first overall selection in the NBA Draft? "
    such a long string....
    in my SonyErricsonk-750 emulator im getting "Who measured in as the tallest and sec" only. rest of the string are invisible.

    I want the whole string to be displayed in 2 or 3 rows.
    How to acheive this

    Please suggest some ideas....

    thanks in advance
    yafy.

  2. #2
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430

    Re: g.drawString()

    You could do this by using Text wrapping
    Please check this link for some sample code (Courtesy Wang )
    http://fotomica.astrientlabs.com/downloads/textwrap.jsp

    Regards
    Gopal

  3. #3
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: g.drawString()

    Hi Yafy,
    Your string gets truncated with respect to the width of the screen.If you want to scroll the text you can go for what gopal has said.

    If you want to show it in two or three lines,then get the screen size or display size...divide the strings into substrings with respect to the screen size and then show it in two to three lines.

    thanks
    Soku

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    33

    Re: g.drawString()

    thanks balagopalks , its really very helpful....

    yafy

Similar Threads

  1. question - a animated canvas during HTTP connection
    By melas21 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2005-04-23, 12:42
  2. g.drawString + Double
    By patricksteiner in forum Mobile Java General
    Replies: 4
    Last Post: 2003-03-26, 14:07

Posting Permissions

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