qSiLкяσad - SiLкяσad σηLiηє qLσвaL wєвSiтє
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Java İle Mors Alfabesinden İngilizceye İngilizceden Mors Alfabesine ÇevirMe

2 posters

Aşağa gitmek

Java İle Mors Alfabesinden İngilizceye İngilizceden Mors Alfabesine ÇevirMe Empty Java İle Mors Alfabesinden İngilizceye İngilizceden Mors Alfabesine ÇevirMe

Mesaj  aSi_ćσćuк Salı Haz. 23, 2009 4:24 pm

Artik güvenli ve istediginiz uzunluk ve charecter özellikleri tasiyan sifre genere edebilirsiniz

Kod:
http://1.File: GUI.java


import javax.swing.*;
import java.awt.*;
import java.awt.event.*;


public class GUI implements MouseListener{

private JFrame frame = null;
private JCheckBox chkBox1 = null;
private JCheckBox chkBox2 = null;
private JCheckBox chkBox3 = null;
private JCheckBox chkBox4 = null;
private JCheckBox chkBox5 = null;
private JTextField txtAnzahlZeichen = null;
private JTextField txtAnzahlPW = null;
private JButton cmdStart = null;
private JPanel panel1 = null;
private JPanel panel2 = null;
private JPanel mainPanel = null;
private JLabel lblTitel1 = null;
private JLabel lblTitel2 = null;

public GUI() {
frame = new JFrame("PWCreator");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
frame.setResizable(false);

chkBox1 = new JCheckBox("a-z");
chkBox2 = new JCheckBox("A-Z");
chkBox3 = new JCheckBox("0-9");
chkBox4 = new JCheckBox("ozel isaretler");
chkBox5 = new JCheckBox("hepsi");

txtAnzahlZeichen = new JTextField();
txtAnzahlPW = new JTextField();

lblTitel1 = new JLabel("Sifrenin uzunlugu");
lblTitel2 = new JLabel("Sifrenin adeti");

cmdStart = new JButton("baslat");
cmdStart.addMouseListener(this);

panel1 = new JPanel(new GridLayout(5, 1));
panel2 = new JPanel(new GridLayout(5, 1));
mainPanel = new JPanel(new GridLayout(1, 2));

panel1.add(chkBox1);
panel1.add(chkBox2);
panel1.add(chkBox3);
panel1.add(chkBox4);
panel1.add(chkBox5);

panel2.add(lblTitel1);
panel2.add(txtAnzahlZeichen);
panel2.add(lblTitel2);
panel2.add(txtAnzahlPW);
panel2.add(cmdStart);

mainPanel.add(panel1);
mainPanel.add(panel2);

frame.setContentPane(mainPanel);
frame.pack();
frame.setVisible(true);


}

public **** mousePressed(MouseEvent e) {
Object source = e.getSource();
CreatePW createPW = null;

if(source == cmdStart) {
try {
int laengePW = Integer.parseInt(txtAnzahlZeichen.getText());
int anzahlPW = Integer.parseInt(txtAnzahlPW.getText());
createPW = new CreatePW("Temp.txt", laengePW, anzahlPW);

if(chkBox1.isSelected()) {
createPW.kleinbuchstaben();
JOptionPane.showMessageDialog(null, "Sifre basariyla olusturulmustur!", "Information", JOptionPane.INFORMATION_MESSAGE);
}else if(chkBox2.isSelected()) {
createPW.grossbuchstaben();
JOptionPane.showMessageDialog(null, "Sifre basariyla olusturulmustur!", "Information", JOptionPane.INFORMATION_MESSAGE);
}else if(chkBox3.isSelected()) {
createPW.zahlen();
JOptionPane.showMessageDialog(null, "Sifre basariyla olusturulmustur!", "Information", JOptionPane.INFORMATION_MESSAGE);
}else if(chkBox4.isSelected()) {
createPW.sonderzeichen();
JOptionPane.showMessageDialog(null, "Sifre basariyla olusturulmustur!", "Information", JOptionPane.INFORMATION_MESSAGE);
}else if(chkBox5.isSelected()) {
createPW.alle();
JOptionPane.showMessageDialog(null, "Sifre basariyla olusturulmustur!", "Information", JOptionPane.INFORMATION_MESSAGE);
}
}catch(Exception exception) {
JOptionPane.showMessageDialog(null, exception.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
}
}


}
public **** mouseClicked(MouseEvent e) {}
public **** mouseEntered(MouseEvent e) {}
public **** mouseExited(MouseEvent e) {}
public **** mouseReleased(MouseEvent e) {}


}


http://2.File: CreatePW.java

import java.io.*;

public class CreatePW {

private String fileName = null;
private int anzahlPW = 0;
private int laengePW = 0;
private FileWriter fileWriter = null;
private BufferedWriter bufferedWriter = null;

public CreatePW(String fileName, int laengePW, int anzahlPW) throws Exception {
this.fileName = fileName;

if(laengePW <= 0 || anzahlPW <1) {
throw new IllegalArgumentException();
}
this.laengePW = laengePW;
this.anzahlPW = anzahlPW;
}

public **** grossbuchstaben() throws Exception {
double zahl = 0.0;
fileWriter = new FileWriter(fileName);
bufferedWriter = new BufferedWriter(fileWriter);

for(int i = 0; i < anzahlPW; i++) {
for(int j = 0; j < laengePW; j++) {
zahl = Math.random();
zahl = zahl * 1000;
zahl = (int) zahl;
if(zahl >= 65 && zahl <= 90){
bufferedWriter.write( (char) zahl);
}else {
j = j - 1;
}
}
bufferedWriter.newLine();
}
bufferedWriter.close();
fileWriter.close();


}

public **** kleinbuchstaben() throws Exception {
double zahl = 0.0;
fileWriter = new FileWriter(fileName);
bufferedWriter = new BufferedWriter(fileWriter);

for(int i = 0; i < anzahlPW; i++) {
for(int j = 0; j < laengePW; j++) {
zahl = Math.random();
zahl = zahl * 1000;
zahl = (int) zahl;
if(zahl >= 97 && zahl <= 122){
bufferedWriter.write( (char) zahl);
}else {
j = j - 1;
}
}
bufferedWriter.newLine();
}
bufferedWriter.close();
fileWriter.close();

}

public **** zahlen() throws Exception {
double zahl = 0.0;
fileWriter = new FileWriter(fileName);
bufferedWriter = new BufferedWriter(fileWriter);

for(int i = 0; i < anzahlPW; i++) {
for(int j = 0; j < laengePW; j++) {
zahl = Math.random();
zahl = zahl * 1000;
zahl = (int) zahl;
if(zahl >= 48 && zahl <= 57){
bufferedWriter.write( (char) zahl);
}else {
j = j - 1;
}
}
bufferedWriter.newLine();
}
bufferedWriter.close();
fileWriter.close();
}

public **** sonderzeichen() throws Exception {
double zahl = 0.0;
fileWriter = new FileWriter(fileName);
bufferedWriter = new BufferedWriter(fileWriter);

for(int i = 0; i < anzahlPW; i++) {
for(int j = 0; j < laengePW; j++) {
zahl = Math.random();
zahl = zahl * 1000;
zahl = (int) zahl;
if((zahl >= 32 && zahl <= 47)|| (zahl >=58 && zahl <=64) || (zahl >= 91 && zahl <= 96) || (zahl >= 123 && zahl <= 126)){
bufferedWriter.write( (char) zahl);
}else {
j = j - 1;
}
}
bufferedWriter.newLine();
}
bufferedWriter.close();
fileWriter.close();

}

public **** alle() throws Exception {
double zahl = 0.0;
fileWriter = new FileWriter(fileName);
bufferedWriter = new BufferedWriter(fileWriter);

for(int i = 0; i < anzahlPW; i++) {
for(int j = 0; j < laengePW; j++) {
zahl = Math.random();
zahl = zahl * 1000;
zahl = (int) zahl;
if(zahl >= 32 && zahl <= 126){
bufferedWriter.write( (char) zahl);
}else {
j = j - 1;
}
}
bufferedWriter.newLine();
}
bufferedWriter.close();
fileWriter.close();
}


}


http://3.File: Sub.java

public class Sub {
public static **** main (String[] args) {
new GUI();

}
}


#####################################
aSi_ćσćuк
aSi_ćσćuк
Admin

Mesaj Sayısı : 102
Kayıt tarihi : 22/06/09
Nerden : GSilkroad'dan

http://gsilkroad.com

Sayfa başına dön Aşağa gitmek

Java İle Mors Alfabesinden İngilizceye İngilizceden Mors Alfabesine ÇevirMe Empty Geri: Java İle Mors Alfabesinden İngilizceye İngilizceden Mors Alfabesine ÇevirMe

Mesaj  Batu[han] Çarş. Haz. 24, 2009 6:33 pm

bunlardan hiç birşey anlamıyorum.Very Happy Very Happy bide pc manyagıyım

Batu[han]

Mesaj Sayısı : 30
Kayıt tarihi : 24/06/09
Yaş : 28
Nerden : Uzaydan

Sayfa başına dön Aşağa gitmek

Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz