首页 > 解决方案 > 我将如何更改此数组列表中的字体和大小?

问题描述

我想更改字体大小和字体样式。字体太小了。我已经尝试了几件事,但似乎都没有奏效。我该怎么做呢?

这是创建的窗口:

https://i.stack.imgur.com/apTJY.jpg

public class Questions {

public ArrayList<String> mind = new ArrayList<>();
public ArrayList<String> energy = new ArrayList<>();
public ArrayList<String> nature = new ArrayList<>();
public ArrayList<String> tactics = new ArrayList<>();
public ArrayList<String> identity = new ArrayList<>();

Questions(){
    pullMind();
    pullEnergy();
    pullNature();
    pullTactics();
    pullIdentity();

}

public ArrayList<String> pullMind()
{

    mind.add(" You feel more energetic after spending time with a group of people.");
    mind.add(" If someone does not respond to your e-mail quickly, you start wondering if you said something wrong.");
    mind.add(" If the room is full, you stay closer to the walls, avoiding the center.");
    mind.add(" You feel very anxious in a stressful situation.");
    mind.add(" You do not usually initiate conversations.");
    mind.add(" You usually find it difficult to relax when talking in front of many people.");
    mind.add(" An interesting book or a video game is often better than a social event.");
    mind.add(" You find it difficult to introduce yourself to other people.");
    mind.add(" You do not mind being at the center of attention.");
    mind.add(" You enjoy going to social events that involve dress-up or role-play activities.");
    mind.add(" It does not take much time to start getting involved in social activities at your new workplace.");
    mind.add(" You are a relatively reserved and quiet person.");

    return mind;

}
public int getMindSize()
{
    return (mind.size());
}

标签: javaarraysarraylisttextfonts

解决方案


该问题与您发布的代码完全无关。它应该是处理字符串字体和大小的 GUI。

以下问题确实显示了如何为 JTextField 设置字体和大小:

当我更改字体时 JTextField 大小发生变化


推荐阅读