📄 logviewerpanel.java
字号:
package cn.ac.siat.dswatcher;import javax.swing.*;import java.util.List;import java.util.ArrayList;import java.awt.*;import java.awt.event.ComponentAdapter;import java.awt.event.ComponentEvent;/** * <p>Title: </p> * <p>Description: Log Viewer</p> * <p>Copyright: Copyright (c) 2007</p> * <p>Company: CGCL </p> * author: Disheng * version 1.0 */public class LogViewerPanel extends JPanel { MotionPanel motionPane; ProcessPanel pPane; static JSplitPane splitPane; public static List frameList = new ArrayList(100); // JSplitPane jSplitPane1 = new JSplitPane(); BorderLayout borderLayout1 = new BorderLayout(); public LogViewerPanel() { try { init(); } catch (Exception ex) { ex.printStackTrace(); } } void init() throws Exception { this.setLayout(borderLayout1); motionPane = new MotionPanel(); pPane = new ProcessPanel(); //this.setBackground(SystemColor.text); splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true); splitPane.add(motionPane, JSplitPane.TOP); JScrollPane scrollPane1 = new JScrollPane(); scrollPane1.getViewport().add(pPane, null); splitPane.add(scrollPane1, JSplitPane.BOTTOM); splitPane.setOneTouchExpandable(true); splitPane.setDividerLocation(250); //定义面板的最小尺寸 Dimension minimumSize = new Dimension(100, 20); motionPane.setMinimumSize(minimumSize); pPane.setMinimumSize(minimumSize); this.add(splitPane, BorderLayout.CENTER); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { splitPane.setDividerLocation(getHeight() * 2 / 3); } }); ControlMenu.lvp = new LogViewerPlayer(getMotionPanel(), getProcessPane(), null); } public MotionPanel getMotionPanel() { return motionPane; } public ProcessPanel getProcessPane() { return pPane; } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame j = new JFrame("a"); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("com.sun.javax.swing.plaf.motif.MotifLookAndFeel"); SwingUtilities.updateComponentTreeUI(j); } catch (Exception e) { e.printStackTrace(); } j.getContentPane().add(new LogViewerPanel()); j.setSize(400, 300); j.setExtendedState(JFrame.MAXIMIZED_BOTH); j.validate(); j.pack(); j.setVisible(true); } }); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -