/* -------------------------------------- テキストボックスの表示 --------------------------------------- */ import java.applet.*; import java.awt.*; public class Applet_Textbox extends Applet { TextField txt; //テキストボックス変数 Label title,title2; //ラベル変数 public void init() { title=new Label("ゲームを始めます"); title.setForeground(Color.red); //文字の色 title.setBackground(Color.green); //背景色 this.add(title); //ラベルの表示 title2=new Label("数字を入れてください(1〜3)"); this.add(title2); txt=new TextField(10); this.add(txt); //テキストボックスの表示 } }