Results 1 to 2 of 2
  1. #1
    andrimuhyidin is offline Member
    Join Date
    Dec 2015
    Posts
    1
    Rep Power
    0

    Smile Align text using string

    How to align text (center,right,left) in java using string and looping ? i need help about it,,, please

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,007
    Rep Power
    34

    Default Re: Align text using string

    Where is the text being shown? I assume the text to be displayed is in a String.
    Do you know the length of the String and the width of the area it is to be displayed in?
    Can the String be positioned by adding some leading spaces?
    If so, do some math to see how many leading spaces need to be added.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. JLabel Align Text
    By OllyHal in forum AWT / Swing
    Replies: 1
    Last Post: 02-18-2012, 03:03 AM
  2. Cant get text to align in JLabel
    By spect4cle in forum AWT / Swing
    Replies: 1
    Last Post: 02-12-2012, 10:19 PM
  3. Replies: 3
    Last Post: 01-10-2012, 11:33 AM
  4. Java: How do i align the text in the center?
    By nicacutenica in forum New To Java
    Replies: 5
    Last Post: 06-29-2010, 07:50 PM
  5. JTextArea - text align
    By bradder in forum AWT / Swing
    Replies: 1
    Last Post: 11-29-2007, 08:08 PM

Tags for this Thread

Posting Permissions

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