Skip to content

How to set the font and font-size of a CodeArea #103

@nkolban

Description

@nkolban

I am wanting to use this package to show some JavaScript code. I wished to change the font and font-size for my CodeArea control and coded:

    codeArea = new CodeArea();
    codeArea.setFont(Font.font("consolas", 11.0));
    codeArea.setParagraphGraphicFactory(LineNumberFactory.get(codeArea));

However, when the control is shown, the font doesn't change but the size is fine however the moment I type a character, the font size changes back to the default. I think I am missing how to set the font for the control as a whole. Would you be able to advise?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions