小编Smn*_*n21的帖子

增加JButton中的字体大小

我无法完成学期项目的最终工作.我正在开发Connect Four游戏,我想增加JButton内部的字体大小.我对编程比较陌生,但我还没有使用任何字体.我只想将按钮内部的字体加倍,以使其在游戏过程中更加醒目.有人可以帮助我,还是指出我找到解决方案的方向?谢谢!我的代码如下.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Connect implements ActionListener {





private JFrame window = new JFrame("Connect Four by Steven and Anthony");    
private JPanel myPanel = new JPanel();
private JPanel myPanelB = new JPanel();
private JButton[][] myButtons = new JButton[6][7];
private JButton[] buttons = new JButton[7];
private boolean win = false;

private int count = 5;
private int count2 = 5;
private int count3 = 5;
private int count4 = 5;
private int count5 = 5;
private …
Run Code Online (Sandbox Code Playgroud)

java size fonts button

7
推荐指数
2
解决办法
5万
查看次数

标签 统计

button ×1

fonts ×1

java ×1

size ×1