📄 statusline.java
字号:
package jmathlib.tools.junit.swingui;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
/**
* A status line component.
*/
public class StatusLine extends JTextField {
public static final Font PLAIN_FONT= new Font("dialog", Font.PLAIN, 12);
public static final Font BOLD_FONT= new Font("dialog", Font.BOLD, 12);
public StatusLine(int preferredWidth) {
super();
setFont(BOLD_FONT);
setEditable(false);
setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
Dimension d= getPreferredSize();
d.width= preferredWidth;
setPreferredSize(d);
}
public void showInfo(String message) {
setFont(PLAIN_FONT);
setForeground(Color.black);
setText(message);
}
public void showError(String status) {
setFont(BOLD_FONT);
setForeground(Color.red);
setText(status);
setToolTipText(status);
}
public void clear() {
setText("");
setToolTipText(null);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -