Java 如何更改此arraylist中的字体和大小?

Java 如何更改此arraylist中的字体和大小?,java,arrays,arraylist,text,fonts,Java,Arrays,Arraylist,Text,Fonts,我想更改字体大小和字体样式。字体太小了。我试过一些方法,但似乎都不管用。我该怎么做呢 以下是已创建的窗口: 公开课问题{ public ArrayList mind=new ArrayList(); 公共ArrayList能量=新ArrayList(); public ArrayList nature=new ArrayList(); 公共ArrayList策略=新建ArrayList(); public ArrayList identity=new ArrayList(); 问题(){ pu

我想更改字体大小和字体样式。字体太小了。我试过一些方法,但似乎都不管用。我该怎么做呢

以下是已创建的窗口:

公开课问题{
public ArrayList mind=new ArrayList();
公共ArrayList能量=新ArrayList();
public ArrayList nature=new ArrayList();
公共ArrayList策略=新建ArrayList();
public ArrayList identity=new ArrayList();
问题(){
pullMind();
能量();
pullNature();
pulltractics();
pullIdentity();
}
公共阵列列表pullMind()
{
加上(“与一群人共度时光后,你会感到更有活力。”);
添加(“如果有人没有快速回复你的电子邮件,你会开始怀疑你是否说错了什么。”);
注意。加上(“如果房间满了,你就离墙近一点,避开中心。”);
加上(“你在紧张的情况下感到非常焦虑。”);
注意。加上(“你通常不会发起对话。”);
加上(“当你在很多人面前讲话时,你通常很难放松。”);
添加(“一本有趣的书或一个电子游戏通常比一个社交活动更好。”);
注意。加上(“你发现很难向别人介绍你自己。”);
添加(“你不介意成为注意力的中心。”);
加上(“你喜欢参加包括化妆或角色扮演活动的社交活动。”);
加上(“在你的新工作场所开始参与社会活动并不需要很多时间。”);
加上(“你是一个相对保守和安静的人。”);
回归心灵;
}
public int getMindSize()
{
返回(mind.size());
}

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

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


如果要在Swing GUI中显示,则需要在其组件上设置字体大小。您使用的是什么图形库?最好将其添加为标记。若要尽快获得更好的帮助,请发布或。
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());
}