menuhandler.java
来自「java实现的代理程序 socket 编程实现的http 和socket 代理程」· Java 代码 · 共 67 行
JAVA
67 行
/* * Created on 24-feb-2004 * * To change the template for this generated file go to Window - Preferences - * Java - Code Generation - Code and Comments */package javatunnel.gui;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.*;import javatunnel.*;/** * @author utopio * * To change the template for this generated type comment go to Window - * Preferences - Java - Code Generation - Code and Comments */public class MenuHandler implements ActionListener { JFrame parent; public MenuHandler(JFrame frame) { parent = frame; } /* * (non-Javadoc) * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent action) { if (action.getActionCommand().equals("Exit")) { Engine.cleanHostsFile(); parent.dispose(); System.exit(0); } if (action.getActionCommand().equals("Redirect")) { System.out.println("Creando redirect"); new NewRedirectDialog(parent); } if (action.getActionCommand().equals("SSL Proxy")) { System.out.println("Creando SSL Proxy"); new NewSSLProxyDialog(parent); } if (action.getActionCommand().equals("Stop")) { System.out.println("Peticion de parada"); stop(); } } private void stop() { if (GraphicalClient.list.getSelectedIndices().length == 1) { Worker selected = (Worker) GraphicalClient.list.getSelectedValue(); selected.shutdownWorker(); ((DefaultListModel) GraphicalClient.list.getModel()).removeElement(selected); //just in case we remove all the list elements and the splitPane colapses to the list side GraphicalClient.splitPane.setDividerLocation(200); } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?