edelweize Admin
Jumlah posting : 255 Points : 401 Reputation : 0 Join date : 26.02.10 Age : 31 Lokasi : In This Forum
| Subyek: Advance Password Generator Version 2.0 [SRC][GUI] Wed Apr 07, 2010 3:26 am | |
| download http://www.mediafire.com/?aujmwzmbwgyuntuk running file .jar nya install java dolo........ JRE (Java Runtime Enviroment)Features: - Randomly generates secure passwords - May copy any selected password to your clipboard - May delete any selected password - May lengthen any selected password - May shorten any selected password - May have a password from 5 characters long to 25 characters long What got added: - A new GUI using only codes - Several new functions and features Use: - To have secure passwords for accounts. Screenshot: - Code:
-
import java.security.SecureRandom;
import javax.swing.DefaultListModel; import javax.swing.JOptionPane; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JList; import javax.swing.ListSelectionModel;
import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.ClipboardOwner; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;
public class Password_Generator implements ClipboardOwner {
protected static final int currPassLength = 5;
protected static SecureRandom srnd = new SecureRandom(); protected static DefaultListModel DLM = new DefaultListModel(); protected static JFrame JF = new JFrame("Password Generator by CometJack"); protected static JButton JB = new JButton("Generate"); protected static JButton JB2 = new JButton("Copy"); protected static JButton JB3 = new JButton("Delete"); protected static JButton JB4 = new JButton("Lengthen"); protected static JButton JB5 = new JButton("Shorten"); protected static JList JL = new JList(DLM); protected static JPanel JP = new JPanel();
protected static char[] passChars = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K','M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '@', '*', '[', ']', '%', '$', '#', '!', '^', '&', '(', ')', '`', '~' };
public static void main(String[] argv) { JL.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); JL.setLayoutOrientation(JList.HORIZONTAL_WRAP); JL.setVisibleRowCount(5); JF.add(JP); JP.add(JB); JP.add(JB2); JP.add(JB3); JP.add(JB4); JP.add(JB5); JP.add(JL); JF.pack(); JF.setLocationRelativeTo(null); JF.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JF.setVisible(true); JL.setBackground(null); JB.addActionListener(new buttonAAction()); JB2.addActionListener(new buttonBAction()); JB3.addActionListener(new buttonCAction()); JB4.addActionListener(new buttonDAction()); JB5.addActionListener(new buttonEAction()); }
static class buttonAAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { StringBuffer SB = new StringBuffer(); for (int iCounterA = 0; iCounterA < currPassLength; iCounterA++) { SB.append(passChars[srnd.nextInt(passChars.length)]); } if (DLM.getSize() < 5){ DLM.addElement(SB.toString()); } else { DLM.clear(); DLM.addElement(SB.toString()); } /* Something I had, I decided not to use it. You can if you want. * * final int iOption = JOptionPane.showConfirmDialog(null, "Max passwords listed, clear all passwords?" * , "Error", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE); * * if (iOption == 0) {*/ JF.pack(); JF.setLocationRelativeTo(null); } } static class buttonBAction implements ActionListener {
public void actionPerformed(ActionEvent arg0) { Password_Generator PG = new Password_Generator(); PG.copyToClipboard(DLM.getElementAt(JL.getSelectedIndex()).toString()); JOptionPane.showConfirmDialog(null, "Password \"" + DLM.getElementAt(JL.getSelectedIndex()).toString() + "\" has been copied." , "Password Copied", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE); } } public void copyToClipboard(String data) { StringSelection SS = new StringSelection(data); Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(SS, this); } public void lostOwnership(Clipboard arg0, Transferable arg1) { } static class buttonCAction implements ActionListener {
public void actionPerformed(ActionEvent arg0) { JOptionPane.showConfirmDialog(null, "Password \"" + DLM.getElementAt(JL.getSelectedIndex()).toString() + "\" has been deleted." , "Password Copied", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE); DLM.removeElementAt(JL.getSelectedIndex()); JF.pack(); JF.setLocationRelativeTo(null); } } static class buttonEAction implements ActionListener {
public void actionPerformed(ActionEvent arg0) { DLM.setElementAt(deleteChar(DLM.getElementAt(JL.getSelectedIndex()).toString()), JL.getSelectedIndex()); JF.pack(); JF.setLocationRelativeTo(null); } static String deleteChar(String data) { StringBuilder SB = new StringBuilder(data); if (SB.length() == 5) { return data; } else { SB.deleteCharAt(SB.length()-1); return SB.toString(); } } } static class buttonDAction implements ActionListener {
public void actionPerformed(ActionEvent arg0) { DLM.setElementAt(addChar(DLM.getElementAt(JL.getSelectedIndex()).toString()), JL.getSelectedIndex()); JF.pack(); JF.setLocationRelativeTo(null); } } static String addChar(String data) { StringBuffer SB3 = new StringBuffer(data); if (SB3.length() == 25) { return data; } else { SB3.append(passChars[srnd.nextInt(passChars.length)]); return SB3.toString(); } } } Credit From CometJack @ HF | |
|
koya777 Global Moderator
Jumlah posting : 43 Points : 54 Reputation : 2 Join date : 07.03.10 Lokasi : /etc/passwd
| Subyek: Re: Advance Password Generator Version 2.0 [SRC][GUI] Wed Apr 07, 2010 3:28 am | |
| | |
|
takecy V.I.P Member
Jumlah posting : 33 Points : 36 Reputation : 1 Join date : 02.03.10 Age : 35 Lokasi : ponorogo
| Subyek: Re: Advance Password Generator Version 2.0 [SRC][GUI] Wed Apr 07, 2010 3:47 am | |
| | |
|
edelweize Admin
Jumlah posting : 255 Points : 401 Reputation : 0 Join date : 26.02.10 Age : 31 Lokasi : In This Forum
| Subyek: Re: Advance Password Generator Version 2.0 [SRC][GUI] Wed Apr 07, 2010 4:10 am | |
| no junk yahh.... | |
|
Bboy_maverick Crew Member
Jumlah posting : 99 Points : 124 Reputation : 0 Join date : 08.03.10 Age : 32 Lokasi : manado
| Subyek: Re: Advance Password Generator Version 2.0 [SRC][GUI] Thu Apr 08, 2010 9:50 pm | |
| | |
|
Sponsored content
| Subyek: Re: Advance Password Generator Version 2.0 [SRC][GUI] | |
| |
|