⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e1315.java

📁 java小程序
💻 JAVA
字号:
import java.awt.*;//Icon是在这个类中
import javax.swing.*;
import java.awt.event.*;
public class E1315 extends JFrame implements ActionListener
{
private Container c;
private JButton copyButton=new JButton("拷贝>>>");
private JTextArea textA1,textA2;
public E1315()
{
super("E1315.java:JTextArea测试");
c=getContentPane();
c.setLayout(new FlowLayout());
textA1=new JTextArea("我喜欢java\n我喜欢javajava",6,15);
JScrollPane  jsp=new JScrollPane(textA1);
textA2=new JTextArea("",6,15);
JScrollPane jsp1=new JScrollPane(textA2);
c.add(jsp);
c.add(copyButton);
c.add(jsp1);
copyButton.addActionListener(this);
setSize(600,400);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==copyButton)
{
textA1.copy();
textA2.paste();
textA2.append("\n");
}
}
public static void main(String args[])
{
E1315 app=new E1315();
app.addWindowListener(new MyWindowListener());
} 
}

⌨️ 快捷键说明

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