00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 package org.objectweb.proactive.core.process.unicore;
00032
00033 import java.awt.*;
00034 import java.awt.event.*;
00035
00036 import javax.swing.*;
00037
00038
00045 public class UnicorePasswordGUI extends JFrame implements ActionListener {
00046 String keypassword = "";
00047 JTextField password;
00048
00049 public synchronized String getKeyPassword() {
00050 while (keypassword.length() <= 0) {
00051 try {
00052 wait();
00053 } catch (InterruptedException e) {
00054 }
00055 }
00056 notifyAll();
00057
00058 return keypassword;
00059 }
00060
00061 public synchronized void setKeyPassword(String keypassword) {
00062 this.keypassword = keypassword;
00063 notifyAll();
00064 }
00065
00066 public UnicorePasswordGUI() {
00067 super("ProActive Unicore Client");
00068
00069 JButton ok = new JButton("OK");
00070 ok.addActionListener(this);
00071
00072 password = new JPasswordField(12);
00073
00074 Container panel = this.getContentPane();
00075 panel.setLayout(new BorderLayout());
00076
00077 panel.add(new JLabel("Input Unicore Keystore Password"),
00078 BorderLayout.NORTH);
00079 panel.add(password, BorderLayout.CENTER);
00080 panel.add(ok, BorderLayout.SOUTH);
00081
00082 this.pack();
00083 this.setVisible(true);
00084 }
00085
00086 public void actionPerformed(ActionEvent e) {
00087 setKeyPassword(password.getText());
00088 this.dispose();
00089 }
00090
00091 public static void main(String[] args) {
00092 UnicorePasswordGUI upGUI = new UnicorePasswordGUI();
00093 System.out.println("password:" + upGUI.getKeyPassword());
00094 }
00095 }