?? quickhttpdialog.java
字號:
/** * File and FTP Explorer * Copyright 2002 * BOESCH Vincent * * This program 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 2 * of the License, or (at your option) any later version. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */package javaexplorer.gui.dialog;import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javaexplorer.Launcher;import javaexplorer.manager.http.*;import javax.swing.*;import javax.swing.border.*;/** *@author BOESCH Vincent *@created 21 janvier 2002 *@version 3.3 * * This program 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 2 * of the License, or (at your option) any later version. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */public class QuickHttpDialog extends JDialog implements ActionListener, Runnable { private Launcher _launcher = null; private BorderLayout borderLayout1 = new BorderLayout(); private GridLayout gridLayout1 = new GridLayout(); private JLabel jLabel1 = new JLabel(); private JPanel jPanel1 = new JPanel(); private JPanel jPanel2 = new JPanel(); private JButton jbtCancel = new JButton(); private JButton jbtConnect = new JButton(); private JTextField jtfHost = new JTextField(); private TitledBorder titledBorder1; private JInternalFrame jif; private String host = null; /** * Constructeur objet QuickFtpDialog * *@param frame Description of the * Parameter *@param launcher Description of the * Parameter */ public QuickHttpDialog(JFrame frame, Launcher launcher) { super(frame, "HTTP Connect...", true); _launcher = launcher; try { jbInit(); } catch (Exception e) { javaexplorer.util.Log.addError(e); } } /** * Description de la methode * *@param e Description of the Parameter */ public void actionPerformed(ActionEvent e) { Object obj = e.getSource(); if (obj == jbtConnect) { this.setVisible(false); createHttp(); } this.dispose(); } /** * Description de la methode */ public void createHttp() { host = jtfHost.getText(); if ((host == null) || (host.length() == 0)) { host = null; } if (host != null) { //run(); jif = _launcher.getMDIModel().makeWaitFrame(host, "Construction en cours"); new Thread(this).start(); } } public void run(){ HttpXF xfile = new HttpXF(); xfile.setLauncher(_launcher); xfile.setAddress(host); //R閏up des fils _launcher.getMDIModel().closeFrame(jif); _launcher.getMDIModel().makeEFFrame(xfile); } /** * Description de la methode * *@throws Exception Description of the * Exception */ private void jbInit() throws Exception { titledBorder1 = new TitledBorder(""); jLabel1.setText("host address"); jtfHost.setToolTipText(""); this.getContentPane().setLayout(borderLayout1); jPanel1.setLayout(gridLayout1); gridLayout1.setRows(1); gridLayout1.setColumns(2); gridLayout1.setHgap(10); gridLayout1.setVgap(5); borderLayout1.setHgap(10); jPanel1.setBorder(titledBorder1); jbtConnect.setText("Connect"); jbtConnect.setToolTipText(""); jbtConnect.addActionListener(this); jbtCancel.setText("Cancel"); jbtCancel.setToolTipText(""); jbtCancel.addActionListener(this); this.setResizable(false); this.getContentPane().add(jPanel1, BorderLayout.CENTER); jPanel1.add(jLabel1, null); jPanel1.add(jtfHost, null); this.getContentPane().add(jPanel2, BorderLayout.SOUTH); jPanel2.add(jbtConnect, null); jPanel2.add(jbtCancel, null); jtfHost.requestFocus(); } /** * Sets the launcher attribute of the * *@param launcher The new launcher value */ public void setLauncher(Launcher launcher) { _launcher = launcher; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -