📄 summarypanel.java
字号:
package view;
//Copyright (C) 2008 Harald Unander, Wang Wenjuan
//
// This file is part of WlanTV.
//
// WlanTV is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// WlanTV is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with WlanTV. If not, see <http://www.gnu.org/licenses/>.
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JTextArea;
@SuppressWarnings("serial")
public class SummaryPanel extends JPanel {
TotalTextArea totalTextArea;
ViewTextArea viewTextArea;
OptTextArea extraTextArea;
PessTextArea fillTransTextArea;
public SummaryPanel() {
setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
totalTextArea = new TotalTextArea();
totalTextArea.setBorder(BorderFactory.createTitledBorder("Totals"));
viewTextArea = new ViewTextArea();
viewTextArea.setBorder(BorderFactory.createTitledBorder("View/Filtered"));
fillTransTextArea = new PessTextArea();
fillTransTextArea.setBorder(BorderFactory.createTitledBorder("Fill transaction details"));
extraTextArea = new OptTextArea();
extraTextArea.setBorder(BorderFactory.createTitledBorder("Available bandwidth"));
// JScrollPane scrollTotalTextArea = new JScrollPane(totalTextArea);
// scrollTotalTextArea.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
// JScrollPane scrollFillTransTextArea = new JScrollPane(fillTransTextArea);
add(totalTextArea);
add(viewTextArea);
add(extraTextArea);
add(fillTransTextArea);
}
public class TotalTextArea extends JTextArea {
public TotalTextArea() {
setTabSize(10);
setEditable(false);
setCaretPosition(0);
}
}
public class ViewTextArea extends JTextArea {
public ViewTextArea() {
setTabSize(12);
setEditable(false);
setCaretPosition(0);
}
}
public class OptTextArea extends JTextArea {
public OptTextArea() {
setTabSize(12);
setEditable(false);
setCaretPosition(0);
}
}
public class PessTextArea extends JTextArea {
public PessTextArea() {
setTabSize(12);
setEditable(false);
setCaretPosition(0);
}
}
public void clear() {
totalTextArea.setText("");
viewTextArea.setText("");
fillTransTextArea.setText("");
extraTextArea.setText("");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -