Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Label;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.peer.TextFieldPeer;
- import java.io.BufferedWriter;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.OutputStreamWriter;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JTextField;
- public class Window extends JFrame {
- String [] textArray = new String [2];
- public void WindowOne(){
- dataManager manage = new dataManager();
- JFrame window = new JFrame();
- window.setLayout(null);
- window.setSize(400, 400);
- window.setTitle("Window PasswordGenerator");
- window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- window.getContentPane().setBackground(Color.white);
- //Lable
- JLabel lableOne = new JLabel();
- lableOne.setText("Platform: ");
- lableOne.setBounds(10, 10,100,30);
- window.add(lableOne);
- JLabel lableTwo = new JLabel();
- lableTwo.setText("Username: ");
- lableTwo.setBounds(10, 50,100,30);
- window.add(lableTwo);
- JLabel lableTree = new JLabel();
- lableTree.setText("Password: ");
- lableTree.setBounds(10, 90,100,30);
- window.add(lableTree);
- //Textfield
- JTextField textfieldOne= new JTextField();
- textfieldOne.setBounds(85,10,150, 30);
- window.add(textfieldOne);
- JTextField textfieldTwo= new JTextField();
- textfieldTwo.setBounds(85,50,150, 30);
- window.add(textfieldTwo);
- one classOne = new one();
- JTextField textfieldTree = new JTextField();
- textfieldTree.setBounds(85, 90, 150, 30);
- textfieldTree.setText(manage.password(16));
- window.add(textfieldTree);
- //Buttom
- JButton buttom = new JButton("Rdy?");
- buttom.setBounds(300, 30, 140, 40);
- window.add(buttom);
- boolean push = false;
- buttom.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- boolean push = true;
- final String textfieldPlattform = textfieldOne.getText().toString();
- final String textfieldUsername = textfieldTwo.getText().toString();
- final String textfieldPassword = textfieldTree.getText().toString();
- try {
- manage.safe(textfieldPassword, textfieldPlattform, textfieldUsername);
- }catch(Exception E){
- System.out.println("Error");
- }
- //String [] textArray = new String [2];
- //textArray [0] = textfieldPlattform;
- //textArray [1] = textfieldUsername;
- //textArray [2] = textfieldPassword;
- System.out.println("Rdy");
- }
- });
- if(push!=false) {
- final String textfieldPlattform = textfieldOne.getText().toString();
- final String textfieldUsername = textfieldTwo.getText().toString();
- final String textfieldPassword = textfieldTree.getText().toString();
- System.out.println("true");
- }
- window.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement