/*
* MainJFrame.java
*
*
*/
package com.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Properties;
import com.test.ThreadScan;
import javax.swing.table.*;
import javax.swing.*;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.ListSelectionEvent;
/**
*
* @author 贺子超
*/
public class MainJFrame extends javax.swing.JFrame {
/** Creates new form MainJFrame */
public MainJFrame() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" 生成的代码 ">//GEN-BEGIN:initComponents
private void initComponents() {
panel3 = new javax.swing.JScrollPane();
table = new javax.swing.JTable();
tipPane = new javax.swing.JScrollPane();
psInfo = new javax.swing.JTextArea();
menu = new javax.swing.JMenuBar();
文件 = new javax.swing.JMenu();
本机信息 = new javax.swing.JMenuItem();
jSeparator2 = new javax.swing.JSeparator();
net = new javax.swing.JMenuItem();
jSeparator3 = new javax.swing.JSeparator();
exit = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
tableVisible = new javax.swing.JMenuItem();
jSeparator1 = new javax.swing.JSeparator();
visible = new javax.swing.JMenuItem();
操作 = new javax.swing.JMenu();
当前进程信息 = new javax.swing.JMenuItem();
jSeparator4 = new javax.swing.JSeparator();
扫描计算机 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("JAVA\u672c\u5730\u76d1\u542c\u8fdc\u7a0b\u626b\u63cf\u7a0b\u5e8f");
setName("mainFrame");
table.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
table.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
table.setCellSelectionEnabled(true);
panel3.setViewportView(table);
psInfo.setColumns(20);
psInfo.setEditable(false);
psInfo.setRows(5);
psInfo.setText("\u4fe1\u606f\u63d0\u793a\u6846");
psInfo.setDragEnabled(true);
psInfo.setVerifyInputWhenFocusTarget(false);
tipPane.setViewportView(psInfo);
menu.setToolTipText("\u6587\u4ef6");
文件.setText("\u6587\u4ef6");
文件.setName("\u6587\u4ef6");
文件.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
文件ActionPerformed(evt);
}
});
本机信息.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
本机信息.setText("\u5f53\u524d\u7cfb\u7edf\u4fe1\u606f");
本机信息.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
本机信息ActionPerformed(evt);
}
});
文件.add(本机信息);
文件.add(jSeparator2);
net.setText("\u7f51\u7edc\u72b6\u6001");
net.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
netActionPerformed(evt);
}
});
文件.add(net);
文件.add(jSeparator3);
exit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.ALT_MASK));
exit.setText("\u9000\u51fa");
exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitActionPerformed(evt);
}
});
文件.add(exit);
menu.add(文件);
jMenu2.setText("\u89c6\u56fe");
jMenu2.setEnabled(false);
tableVisible.setText("\u663e\u793a\u4fe1\u606f\u8868\u683c");
tableVisible.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tableVisibleActionPerformed(evt);
}
});
jMenu2.add(tableVisible);
jMenu2.add(jSeparator1);
visible.setText("\u9690\u85cf\u63d0\u793a\u6846");
visible.setName("\u663e\u793a\u63d0\u793a\u6846");
visible.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
visibleActionPerformed(evt);
}
});
jMenu2.add(visible);
menu.add(jMenu2);
操作.setText("\u64cd\u4f5c");
当前进程信息.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.ALT_MASK));
当前进程信息.setText("\u5f53\u524d\u8fdb\u7a0b");
当前进程信息.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
当前进程信息ActionPerformed(evt);
}
});
操作.add(当前进程信息);
操作.add(jSeparator4);
扫描计算机.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK));
扫描计算机.setText("\u626b\u63cf\u8ba1\u7b97\u673a");
扫描计算机.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
扫描计算机ActionPerformed(evt);
}
});
操作.add(扫描计算机);
menu.add(操作);
setJMenuBar(menu);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(tipPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE)
.add(10, 10, 10))
.add(org.jdesktop.layout.GroupLayout.TRAILING, panel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 381, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.add(panel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(tipPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void netActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_netActionPerformed
// TODO 将在此处添加您的处理代码:
panel3.setVisible(false);
// panel3.setEnabled(false);
//table.setEnabled(false);
tipPane.setVisible(true);
psInfo.setVisible(true);
tipPane.setLocation(0,0);
tipPane.setSize(381,260);
psInfo.setSize(3