📄 selecttext.java
字号:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class SelectText extends Applet implements ActionListener
{
Label l=new Label("TextArea And TextField");
TextField tf=new TextField(40);
TextArea ta=new TextArea("Please select the string which you want in the TextArea\nand then please click the button \"copy\"\nthen the select string will be copied to the TextField",3,50);
Button bt=new Button("copy");
public void init()
{
add(l);
add(ta);
add(bt);
add(tf);
bt.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
String s;
s=ta.getSelectedText();
if(evt.getActionCommand().equals("copy"))
tf.setText(s);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -