Only half of the letters of the component are seen - cn1

泪湿孤枕 提交于 2020-01-13 20:31:23

问题


I used bold ttf font and it works but only half of the letters are seen.

Code:

public void start() {
    if (current != null) {
        current.show();
        return;
    }

    Label testLabel = new Label("Bold Font Not Working");
    testLabel.setUIID("smallBold");

    Form splashForm = new Form(new BorderLayout());
    splashForm.add(BorderLayout.CENTER, BoxLayout.encloseY(testLabel));
    splashForm.show();

    splashForm.revalidate();
}

UIID in theme for unselected, selected and pressed style

How it looks now

However without wrapping it in boxlayout or flowlayout and directly adding it in the form with borderlayout works. P.S if the form is in boxlayout, it doesn't work

Code:

public void start() {
    if (current != null) {
        current.show();
        return;
    }

    Label testLabel = new Label("Bold Font Not Working");
    testLabel.setUIID("smallBold");

    Form splashForm = new Form(new BorderLayout());
    splashForm.add(BorderLayout.CENTER, testLabel);// this works
    splashForm.show();

    splashForm.revalidate();
}

Image when the label is not wrapped in other containers

来源:https://stackoverflow.com/questions/53465390/only-half-of-the-letters-of-the-component-are-seen-cn1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!