📄 dlgcustomscaninfo.java
字号:
package src;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JToggleButton;
public class DlgCustomScanInfo extends JDialog {
public static JProgressBar progressBar;
public static JToggleButton toggleButton;
public DlgCustomScanInfo() {
super();
setTitle("自定义扫描");
final JPanel panel = new JPanel();
final FlowLayout flowLayout = new FlowLayout();
flowLayout.setAlignment(FlowLayout.LEFT);
panel.setLayout(flowLayout);
panel.setBackground(Color.BLACK);
getContentPane().add(panel, BorderLayout.NORTH);
final JLabel label = new JLabel();
label.setForeground(Color.GREEN);
label.setText("进度:");
panel.add(label);
progressBar = new JProgressBar();
progressBar.setPreferredSize(new Dimension(300, 16));
panel.add(progressBar);
toggleButton = new JToggleButton();
toggleButton.setEnabled(false);
toggleButton.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
if(ScannerGUI.textArea.getText().equals("")){
ScannerGUI.textArea.setText("没有找到开放端口...");
}
dispose();
}
});
toggleButton.setPreferredSize(new Dimension(80, 16));
toggleButton.setText("确定(O)");
panel.add(toggleButton);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -