The Artima Developer Community
Sponsored Link

Java Answers Forum
Formatting text in GUI

1 reply on 1 page. Most recent reply: Apr 27, 2004 1:46 AM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Ja Ja Binks

Posts: 14
Nickname: ds99bwood9
Registered: Apr, 2004

Formatting text in GUI Posted: Apr 22, 2004 2:46 PM
Reply to this message Reply
Advertisement
I am currently constructing a Vcr GUI, but in my JList I have created for presenting text within the GUI, one of the parts of the specification is that the different elements of the text should be formatted so that they are all aligned i.e. one string below the other. What would be the best way of achieving this? I was thinking of using the StringBuffer class to append a empty space after a character, or would there be an easier way of achieving my objective?!


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Formatting text in GUI Posted: Apr 27, 2004 1:46 AM
Reply to this message Reply
1.Use a Font like Courier, where all characters have the sam width.

2. Instead of storing a String of variable Length use a Array of chars. For a VCR display that would be more useful, since you only have a limited view area.

3. Create some methods to clear a certain area of the array (fill it with blanks), to insert a String at a certain position in the array, ...

Flat View: This topic has 1 reply on 1 page
Topic: simple opinion requested on best OOP solution Previous Topic   Next Topic Topic: need help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use