📄 consolepane.java
字号:
package my_cpt;
import super_cpt.*;
import java.awt.*;
import java.awt.event.*;
public class ConsolePane extends SuperPane implements ActionListener{
/**
* @param args
*/
//private IActionExcutor iexcuter=null;
TextArea txt=new TextArea("-------数据结果输出-------\n");
public SuperBtn okbtn=new SuperBtn("-------清空-------");
public ConsolePane()
{
super("结果输出面板");
setLayout(null);
add(okbtn);
add(txt);
txt.setEditable(false);
txt.setIgnoreRepaint(true);
txt.setBackground(Color.WHITE);
okbtn.addActionListener(this);
Direction=2;
HidenSide=RIGHT;
}
public void actionPerformed(ActionEvent e)
{//按钮事件处理
if(e.getSource()==okbtn)
clear();
}
public void showText(final String strtxt)
{
txt.append(strtxt);
}
public void clear()
{
txt.setText("-------数据结果输出-------\n");
}
public String getConsole()
{
return txt.getText();
}
boolean isbool=true;
public void myPaint(Graphics2D g)
{
if(isbool)
{
txt.setBounds(5,25,getWidth()-10,getHeight()-50);
okbtn.setBounds(getWidth()/2-50,txt.getY()+txt.getHeight()+2,96,16);
isbool=false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -