Hi Daniel,

For equal spacing try using Monospace fonts:

Monospace fonts (Such as Courier or LetterGothic, Lucida Console), or "fixed 
pitch" fonts, contain characters that all have the same character width, 
producing text that can be used to create forms, tabular material or documents 
that require exact text line lengths. An example of a fixed pitch font is 
Courier 12 pitch, which is a 10 point font that will print at exactly 12 
characters per inch.

See the snippet below.

I hope this helps.

Thanks and regard,

Janak

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED]
Sent: Friday, April 13, 2007 1:04 PM
To: [EMAIL PROTECTED]
Subject: [ULC-developer] Set the font in ULCTextArea



Hi, 

I need to be able to set the font in a ULCTextArea to something that uses same 
width block letterring, so that all characters arre equally wide. 
I use textArea.setFont(new Font("Arial, SansSerif", Font.PLAIN, 12)) but it is 
not working the width of space(blank is too small). 

here  I have an example: 

       Betrag      offen Belegdatum Zahlungstyp    Bezahlt 
      -97,40€      0,00€ 05.07.2006 Kundenzahlung  Ja       
       97,40€      0,00€ 19.06.2006 Rechnung       Ja       
       88,00€      0,00€ 31.03.2006 Kundenzahlung  Ja   

Freundliche Grüße

Daniel Berinde
Senior Softwareentwickler
Softwareentwicklung

ITM Research GmbH
Blücherstraße 32
D-75177 Pforzheim

Tel.: + 49 7231 / 563 76-410
Fax: + 49 7231 / 563 76-66

http://www.itm-research.de
[EMAIL PROTECTED]

--------------------------------------

import com.ulcjava.base.application.AbstractApplication;
import com.ulcjava.base.application.ULCBorderLayoutPane;
import com.ulcjava.base.application.ULCFrame;
import com.ulcjava.base.application.ULCTextArea;
import com.ulcjava.base.application.util.Font;
import com.ulcjava.base.development.DevelopmentRunner;

public class MonospaceFontSnippet extends AbstractApplication {
   
    private String text = 
        " Betrag      offen Belegdatum Zahlungstyp    Bezahlt\n" +
        "-97,40€      0,00€ 05.07.2006 Kundenzahlung  Ja\n" +
        " 97,40€      0,00€ 19.06.2006 Rechnung       Ja\n" +       
        " 88,00€      0,00€ 31.03.2006 Kundenzahlung  Ja";
         
    public void start() {
        ULCFrame frame = new ULCFrame("MonospaceFontSnippet");
        ULCTextArea world = new ULCTextArea( "\n" + text);
        world.setFont(new Font( "Courier", Font.PLAIN, 12));
        frame.getContentPane().add(world, ULCBorderLayoutPane.CENTER);

                frame.setDefaultCloseOperation(ULCFrame.TERMINATE_ON_CLOSE);
                frame.setSize(400, 300);
                frame.setVisible(true);

        }

        public static void main(String[] args) {
                
DevelopmentRunner.setApplicationClass(MonospaceFontSnippet.class);
                DevelopmentRunner.run();
        }
}

_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to