📄 sorterface.java
字号:
import java.applet.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
public class sorterFace extends Applet implements ActionListener
{
public JTextField inPut = new JTextField ();
public JButton send = new JButton("输入");
public JButton exite = new JButton("退出");
public JLabel outPut = new JLabel ();
public void init()
{
inPut.addActionListener(this);
inPut. setColumns(21);
inPut. setBackground(Color.pink);
inPut. setBorder(new LineBorder(Color.gray));
inPut. setFont(new Font("Serif", Font.PLAIN, 18));
JPanel p1=new JPanel();
p1.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
p1.setBackground(Color.yellow);
p1.add(send);
p1.add(exite);
JPanel p2=new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
p2.setBackground(Color.yellow);
outPut.setText(" 输出去区 ");
p2.add(outPut);
JPanel p3=new JPanel();
p3.setLayout(new BoxLayout(p3, BoxLayout.Y_AXIS));//p3.setLayout(new BoxLayout());
p3.setBorder(new LineBorder(Color.green));
p3.add(inPut);
p3.add( p1);
p3.add( p2 );
send .addActionListener(this);
exite .addActionListener(this);
setLayout(new FlowLayout());
add(p3);
}
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand().equals("输入"))
{
sorterOut Out=new sorterOut(this);
Out.so();
}
if(e.getActionCommand().equals("退出"))
{
inPut.setText("");
outPut.setForeground(Color.black);
outPut.setText("输出去区");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -