Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: drawString elements

  1. #1
    Member
    Join Date
    Sep 2013
    Posts
    102
    Thanks
    38
    Thanked 0 Times in 0 Posts

    Default drawString elements

    Does anybody know off-hand what expression java is using to discern sentence spacing/text width? While fontMetrics is fine, I am looking for graphics' drawstring method's (not to be redundant) methods ... I will eventually just dig through my zipped source code, but would appreciate an easy response here.

    P.S: I am new here I apologize if this seems like just a lazy question. I am not yet sure how I use this forum: do I simply post here for problems like above; ones I can solve but would require more work for me than a person whom has already dealt with this issue and can quickly resolve it. Or simply a tool for complex problems that have thwarted me seemingly indefinitely.


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: drawString elements

    Quote Originally Posted by KAJLogic View Post
    I am not yet sure how I use this forum: do I simply post here for problems like above; ones I can solve
    We aim to give suggestions to people on how to solve problems their self, and refrain from giving straight answers in an attempt to avoid academic dishonesty among students who like to post their assignments and copy-paste answers. Plus it gives the OP a chance to exercise their problem solving skills.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: drawString elements

    A lot of classes that have set... methods also have pairing get... methods. If you want to see what the default value is, call the get... method and print the results.
    If you don't understand my answer, don't ignore it, ask a question.

  4. #4
    Member
    Join Date
    Sep 2013
    Posts
    102
    Thanks
    38
    Thanked 0 Times in 0 Posts

    Default Re: drawString elements

    Thanks to both of you. Norm that is excellent I was going to stumble through the, intentions aside, messy API descriptions. Also, if this seems wrong to anyone please let me know, it seems that all letters of a specified font metric have the SAME width and height.

Similar Threads

  1. Something weird with Graphics and drawString...
    By JamEngulfer221 in forum AWT / Java Swing
    Replies: 15
    Last Post: December 11th, 2011, 07:28 AM
  2. [SOLVED] ArrayList object's elements confusing??? doesnt replace the elements? set() method?
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 10
    Last Post: June 21st, 2011, 01:20 PM
  3. drawString
    By frozen java in forum Java Theory & Questions
    Replies: 17
    Last Post: June 14th, 2011, 04:36 PM
  4. drawString and JTextField
    By that_guy in forum AWT / Java Swing
    Replies: 9
    Last Post: January 29th, 2011, 02:43 AM
  5. Click to start and drawString fonts
    By Campos in forum Java Applets
    Replies: 3
    Last Post: July 24th, 2009, 02:24 PM