package theGhastModding.midiToolbox.main;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPasswordField;

@SuppressWarnings("serial")
public class PasswordInputFrame extends JDialog {
	
	private JPasswordField passwordField;
	
	public PasswordInputFrame(JFrame f){
		super(f, "Enter Password");
		setModal(true);
		setPreferredSize(new Dimension(300,120));
		
		pack();
		getContentPane().setLayout(null);
		
		passwordField = new JPasswordField();
		passwordField.setBounds(10, 25, 264, 20);
		getContentPane().add(passwordField);
		
		JButton btnOk = new JButton("OK");
		btnOk.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				setVisible(false);
			}
		});
		btnOk.setBounds(97, 47, 90, 23);
		getContentPane().add(btnOk);
		setVisible(true);
	}
	
	public char[] getPassword(){
		return passwordField.getPassword();
	}
	
}
