📄 framecpdown.java
字号:
package cproissue;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import javax.swing.JButton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.util.Enumeration;
import java.lang.reflect.Method;
import java.io.*;
import java.security.*;
import java.security.cert.*;
import java.util.Date;
import java.math.*;
import sun.security.x509.*;
import com.borland.jbcl.layout.*;
import javax.swing.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class FrameCPDown extends JFrame {
JLabel jLabel1 = new JLabel();
XYLayout xYLayout1 = new XYLayout();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
CertEntity ce;
public FrameCPDown() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
public FrameCPDown(CertEntity ce) {
try {
jbInit();
this.ce=ce;
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(xYLayout1);
this.setTitle("申请证书");
jLabel1.setText("第二步:导出自签证书。");
jButton2.setText("取消");
jButton2.addActionListener(new FrameCPDown_jButton2_actionAdapter(this));
jButton1.addActionListener(new FrameCPDown_jButton1_actionAdapter(this));
this.getContentPane().add(jButton1, new XYConstraints(81, 172, -1, -1));
this.getContentPane().add(jLabel1, new XYConstraints(127, 76, 282, -1));
jButton1.setText("下一步");
this.getContentPane().add(jButton2, new XYConstraints(241, 172, 69, -1));
}
//第二步
public void jButton1_actionPerformed(ActionEvent e) {
try
{
//导出自签证书
String ss = "keytool -export -alias "+ce.cuser+" -file "+ce.cuser+
".cer -keystore mykeystore -storepass "+ce.stroepass+"";
String cmd = "cmd /E:ON /c start " + ss;
Runtime.getRuntime().exec(cmd);
//进入第三步
FrameCIssue cif=new FrameCIssue(ce);
cif.setSize(400,350);
cif.setLocation(312,234);
cif.setVisible(true);
this.dispose();
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
}
}
//返回主界面
public void jButton2_actionPerformed(ActionEvent e) {
this.dispose();
}
}
class FrameCPDown_jButton2_actionAdapter implements ActionListener {
private FrameCPDown adaptee;
FrameCPDown_jButton2_actionAdapter(FrameCPDown adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class FrameCPDown_jButton1_actionAdapter implements ActionListener {
private FrameCPDown adaptee;
FrameCPDown_jButton1_actionAdapter(FrameCPDown adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -