textfieldprg.java

来自「java练习程序」· Java 代码 · 共 44 行

JAVA
44
字号
import java.applet.*;
import java.awt.*;

public class TextFieldprg extends Applet
{
  TextField text1,text2,text3;
  public void init()
  {
  	text1=new TextField("输入密码: ",10);
  	text1.setEditable(false);
  	text2=new TextField(10);
  	text2.setEchoChar('*'); 	
  	text3=new TextField("文本框",20);

	text3.setForeground(Color.blue);
	text3.setBackground(Color.red);
  	
  	add(text1);
  	add(text2);
  	add(text3);
  	text3.setText("帅");
  }
}
/*
public class ch8_1 extends Applet
{
  TextField text1,text2,text3;
  String s;
  public void init()
  {
  	text1=new TextField("输入密码: ",10);
  	text1.setEditable(false);
  	text2=new TextField(10);
//  	text2.setEchoChar('*'); 	
  	text3=new TextField("文本框",20);
  	
  	add(text1);
  	add(text2);
  	add(text3);
  	s=text2.getText();
  	text3.setText(s);
  }
}
*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?