我正在尝试制作一个菲律宾智力游戏,我希望使用一个数组随机生成文本,并将其显示在JLabel上,有人能帮助我吗?我尝试在网络上查找,但我找不到任何信息。以下是我的一些代码:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class SuperHenyo extends JFrame implements ActionListener {
String bagay[] = {
"Gitara", "Timba", "Tuwalya", "Telebisyon", "Laptop", "Bintilador", "Relo", "Jacket", "Medyas", "Bumbilya"
};
JButton bBtn = new JButton("BAGAY");
public SuperHenyo() {}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == bBtn) {
}