import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
class benutzeranmeldung extends Frame implements ItemListener,WindowListener,ActionListener{
Choice suchen=new Choice();
Choice sortieren=new Choice();
int anzahl=1000;
benutzer[] arr=new benutzer[anzahl];
Button b1=new Button("Einfügen");
Button b2=new Button("Speichern");
Button b3=new Button("Laden");
Button b4=new Button("anzeigen");
Button b5=new Button("<< Previous");
Button b6=new Button("Next >>");
Button b7=new Button("E- Mail schreiben");
Button b8=new Button("Datenbank vollst. löschen");
Button b9=new Button("Einzelne Benutzer löschen");
Button b10=new Button("Login");
Label l1=new Label("Gewünschter Benutzername: *");
Label l2=new Label("Passwort: *");
Label l3=new Label("E- Mailadresse: *");
Label l4=new Label("Alter:");
Label l5=new Label("ICQ- Nummer:");
Label l6=new Label("Aol Instant Messenger:");
Label l7=new Label("Eigene Homepage:");
Label l8=new Label("Interessen:");
Label l9=new Label("Suchen nach:");
Label l10=new Label("Sortieren nach:");
Label l11=new Label("Alle Benutzer");
Label l12=new Label("lassen.");
Label l13=new Label("Bei Problemen:");
Label l14=new Label("Anmeldung");
Label l15=new Label("Suchbegriff:");
Label l16=new Label(" ");
Label l17=new Label("Felder mit * müssen ausgefüllt werden");
Label l18=new Label("http://");
Label l19=new Label("Daten");
Label l20=new Label("auf Datenbank");
Label l21=new Label("von Datenbank");
Label l22=new Label("Daten");
Label l23=new Label("Daten");
Label l24=new Label("Administratorbereich");
Label l25=new Label("Welche Aktion wollen sie durchführen?");
Label l26=new Label("User- Bereich");
Label l27=new Label("");
Label l28=new Label("");
Label l29=new Label("Login");
Label l30=new Label("Benutzername:");
Label l31=new Label("Passwort:");
Label l32=new Label("");
Label l33=new Label("");
Label l34=new Label("");
Label l35=new Label("");
TextField tf1=new TextField();
TextField tf2=new TextField();
TextField tf3=new TextField();
TextField tf4=new TextField();
TextField tf5=new TextField();
TextField tf6=new TextField();
TextField tf7=new TextField();
TextField tf8=new TextField();
TextField tf9=new TextField();
TextField tf10=new TextField();
TextField tf11=new TextField();
TextArea ta=new TextArea();
Panel admin=new Panel();
Panel all=new Panel();
int counter=0;
int arraysize=0;
public void windowClosing(WindowEvent e) {
System.exit(0);
this.dispose();
}
//Rest der Window-Events nicht beachten
public void windowOpened(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
public void windowActivated(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public void mouseReleased(MouseEvent e){}
public void mousePressed(MouseEvent e){}
public void mosueExited(MouseEvent e){}
public void mouseEntered(MouseEvent e){}
public void itemStateChanged(ItemEvent evt)
{
Choice pdm1=(Choice)evt.getSource();
if (pdm1==suchen)
{
if(suchen.getSelectedItem().equals("Benutzername")){
if (!tf9.getText().equals("")){
search_name();
}
else {ta.setText("Bitte Suchbegriff eingeben!");}
}
if(suchen.getSelectedItem().equals("ICQ- Nummer")){
if (!tf9.getText().equals("")){
search_icq();
}
else {ta.setText("Bitte Suchbegriff eingeben!");}
}
if(suchen.getSelectedItem().equals("AIM")){
if (!tf9.getText().equals("")){
search_aim();
}
else {ta.setText("Bitte Suchbegriff eingeben!");}
}
}
Choice pdm2=(Choice)evt.getSource();
if (pdm2==sortieren)
{
if(sortieren.getSelectedItem().equals("Benutzername")){
sort_name();
}
if(sortieren.getSelectedItem().equals("AIM")){
sort_aim();
}
if(sortieren.getSelectedItem().equals("ICQ- Nummer")){
sort_icq();
}
}
}
public void actionPerformed(ActionEvent e)
{
if (e.getActionCommand().equals("E- Mail schreiben"))
{ mail ma=new mail();
ma.resize(400,500);
ma.show();
}
if (e.getActionCommand().equals("Datenbank vollst. löschen")){
admin win=new admin();
win.resize(275,175);
win.show();
}
if (e.getActionCommand().equals("Einzelne Benutzer löschen")){
admin win=new admin();
win.resize(275,175);
win.show();
}
if (e.getActionCommand().equals("Speichern")){
save();
}
if (e.getActionCommand().equals("Laden")){
load();
}
if (e.getActionCommand().equals("anzeigen")){
showall();
}
if (e.getActionCommand().equals("Next >>")){
counter=counter+1;
next();
}
if (e.getActionCommand().equals("<< Previous")){
counter=counter-1;
previous();
}
if (e.getActionCommand().equals("Login")){
login();
}
if (e.getActionCommand().equals("Einfügen")){
String benutzername=tf1.getText();
String passwort=tf2.getText();
String email=tf3.getText();
String alter=tf4.getText();
String icq=tf5.getText();
String aim=tf6.getText();
String website=tf7.getText();
String interessen=tf8.getText();
einfuegen(benutzername,passwort,email,alter,icq,aim,website,interessen);
tf1.setText("");
tf2.setText("");
tf3.setText("");
tf4.setText("");
tf5.setText("");
tf6.setText("");
tf7.setText("");
tf8.setText("");
}
}
public benutzeranmeldung(){
super("Benutzeranmeldung");
addWindowListener(this);
buttonaction buttonevents=new buttonaction(this);
b10.addActionListener(buttonevents);
int i=0;
while (i<anzahl){
arr[i]=new benutzer();
i=i+1;
}
all.setLayout(null);
l14.setBounds(250,25,100,40);
add(l14);
l1.setBounds(25,70,200,30);tf1.setBounds(300,70,275,25);
l2.setBounds(25,100,200,30);tf2.setBounds(300,100,275,25);
l3.setBounds(25,130,200,30);tf3.setBounds(300,130,275,25);
l4.setBounds(25,170,200,30);tf4.setBounds(300,170,275,25);
l5.setBounds(25,200,200,30);tf5.setBounds(300,200,275,25);
l6.setBounds(25,230,200,30);tf6.setBounds(300,230,275,25);
l7.setBounds(25,260,200,30);l18.setBounds(300,260,40,25);tf7.setBounds(345,260,230,25);
l8.setBounds(25,290,200,30);tf8.setBounds(300,290,275,25);
add(l1);add(tf1);
add(l2);add(tf2);
add(l3);add(tf3);
add(l4);add(tf4);
add(l5);add(tf5);
add(l6);add(tf6);
add(l7);add(l18);add(tf7);
add(l8);add(tf8);
l17.setBounds(25,315,225,30);
add(l17);
l19.setBounds(38,380,40,10);
l22.setBounds(135,370,40,10);
l20.setBounds(114,380,80,10);
l23.setBounds(229,370,80,10);
l21.setBounds(207,380,80,10);
b1.setBounds(15,395,80,30);
b2.setBounds(110,395,80,30);
b3.setBounds(205,395,80,30);
add(l19);add(b1);
add(l20);add(b2);
add(l21);add(b3);
add(l22);add(l23);
l15.setBounds(25,480,120,30);
tf9.setBounds(150,480,120,25);
l9.setBounds(25,515,120,30);
suchen.setBounds(150,515,120,30);
l10.setBounds(25,590,120,30);
sortieren.setBounds(150,590,120,30);
add(l15);
add(tf9);
add(l9);
add(l10);
add(suchen);
add(sortieren);
l11.setBounds(25,665,100,30);
b4.setBounds(125,665,85,25);
l12.setBounds(225,665,50,30);
add(l11);
add(b4);
add(l12);
l13.setBounds(25,725,100,30);
b7.setBounds(145,725,135,25);
add(l13);
add(b7);
ta.setBounds(330,365,245,225);
add(ta);
b5.setBounds(330,600,75,25);
b6.setBounds(500,600,75,25);
add(b5);
add(b6);
l24.setBounds(715,25,165,40);
l25.setBounds(645,70,305,22);
b8.setBounds(670,105,150,25);b9.setBounds(670,140,150,25);
l27.setBounds(645,70,2,120);l28.setBounds(948,70,2,120);
l35.setBounds(645,190,305,2);
add(l24);add(l25);
add(b8);add(b9);
add(l27);add(l28);add(l35);
l26.setBounds(750,425,110,25);
l29.setBounds(645,455,305,22);
l30.setBounds(665,485,100,30);tf10.setBounds(775,485,165,25);
l31.setBounds(665,515,100,30);tf11.setBounds(775,515,165,25);
b10.setBounds(775,555,80,22);
l32.setBounds(645,475,2,120);l33.setBounds(948,475,2,120);l34.setBounds(645,595,305,2);
add(l26);add(l29);
add(l30);add(l31);
add(tf10);add(tf11);
add(b10);
add(l32);add(l33);add(l34);
add("Center",all);
//layout anfang
//alle Labels Anfang
Font f1=new Font("Arial",Font.PLAIN,14);
l1.setFont(f1);l2.setFont(f1);
l3.setFont(f1);l4.setFont(f1);
l5.setFont(f1);l6.setFont(f1);
l7.setFont(f1);l8.setFont(f1);
l9.setFont(f1);l10.setFont(f1);
l11.setFont(f1);l12.setFont(f1);
l13.setFont(f1);l15.setFont(f1);
l18.setFont(f1);l25.setFont(f1);
l29.setFont(f1);l30.setFont(f1);
l31.setFont(f1);
Font f9=new Font("Arial",Font.PLAIN,10);
l19.setFont(f9);l20.setFont(f9);
l21.setFont(f9);l22.setFont(f9);
l23.setFont(f9);
//alle Labels Ende
//Überschrift Anfang
Font f3=new Font("Arial",Font.BOLD,16);
l14.setFont(f3);
l24.setFont(f3);
l26.setFont(f3);
//Überschrift Ende
//Sternchen Anfang
Font f6=new Font("Arial",Font.PLAIN,12);
l17.setFont(f6);
l17.setForeground(new Color(0,80,0));
//Sternchen Ende
//alle Textfelder Anfang
Font f4=new Font("Arial",Font.BOLD,14);
tf1.setFont(f4);tf2.setFont(f4);
tf3.setFont(f4);
Font f7=new Font("Arial",Font.PLAIN,14);
tf4.setFont(f7);tf5.setFont(f7);
tf6.setFont(f7);tf7.setFont(f7);
tf8.setFont(f7);ta.setFont(f7);
tf9.setFont(f7);tf10.setFont(f7);
tf11.setFont(f7);
//alle Textfelder Ende
//Hintergrund Panels Anfang
all.setBackground(new Color(80,80,80));
//Hintergrund Panels Ende
//Hintergrund Textfelder + Label Anfang
tf1.setBackground(new Color(0,0,0));
tf2.setBackground(new Color(0,0,0));
tf3.setBackground(new Color(0,0,0));
tf4.setBackground(new Color(0,0,0));
tf5.setBackground(new Color(0,0,0));
tf6.setBackground(new Color(0,0,0));
tf7.setBackground(new Color(0,0,0));
tf8.setBackground(new Color(0,0,0));
tf9.setBackground(new Color(0,0,0));
tf10.setBackground(new Color(0,0,0));
tf11.setBackground(new Color(0,0,0));
ta.setBackground(new Color(0,0,0));
l1.setBackground(new Color(80,80,80));
l2.setBackground(new Color(80,80,80));
l3.setBackground(new Color(80,80,80));
l4.setBackground(new Color(80,80,80));
l5.setBackground(new Color(80,80,80));
l6.setBackground(new Color(80,80,80));
l7.setBackground(new Color(80,80,80));
l8.setBackground(new Color(80,80,80));
l9.setBackground(new Color(80,80,80));
l10.setBackground(new Color(80,80,80));
l11.setBackground(new Color(80,80,80));
l12.setBackground(new Color(80,80,80));
l13.setBackground(new Color(80,80,80));
l14.setBackground(new Color(80,80,80));
l15.setBackground(new Color(80,80,80));
l16.setBackground(new Color(80,80,80));
l17.setBackground(new Color(80,80,80));
l18.setBackground(new Color(80,80,80));
l19.setBackground(new Color(80,80,80));
l20.setBackground(new Color(80,80,80));
l21.setBackground(new Color(80,80,80));
l22.setBackground(new Color(80,80,80));
l23.setBackground(new Color(80,80,80));
l24.setBackground(new Color(80,80,80));
l25.setBackground(new Color(0,0,0));
l26.setBackground(new Color(80,80,80));
l27.setBackground(new Color(0,0,0));
l28.setBackground(new Color(0,0,0));
l29.setBackground(new Color(0,0,0));
l30.setBackground(new Color(80,80,80));
l31.setBackground(new Color(80,80,80));
l32.setBackground(new Color(0,0,0));
l33.setBackground(new Color(0,0,0));
l34.setBackground(new Color(0,0,0));
l35.setBackground(new Color(0,0,0));
//Hintergund Textfelder + Label Ende
//Schriftfarbe aller Labels + Textfelder Anfang
tf1.setForeground(new Color(255,255,255));
tf2.setForeground(new Color(255,255,255));
tf3.setForeground(new Color(255,255,255));
tf4.setForeground(new Color(255,255,255));
tf5.setForeground(new Color(255,255,255));
tf6.setForeground(new Color(255,255,255));
tf7.setForeground(new Color(255,255,255));
tf8.setForeground(new Color(255,255,255));
tf9.setForeground(new Color(255,255,255));
tf10.setForeground(new Color(255,255,255));
tf11.setForeground(new Color(255,255,255));
ta.setForeground(new Color(255,255,255));
l1.setForeground(new Color(255,255,255));
l2.setForeground(new Color(255,255,255));
l3.setForeground(new Color(255,255,255));
l4.setForeground(new Color(255,255,255));
l5.setForeground(new Color(255,255,255));
l6.setForeground(new Color(255,255,255));
l7.setForeground(new Color(255,255,255));
l8.setForeground(new Color(255,255,255));
l9.setForeground(new Color(255,255,255));
l10.setForeground(new Color(255,255,255));
l11.setForeground(new Color(255,255,255));
l12.setForeground(new Color(255,255,255));
l13.setForeground(new Color(255,255,255));
l14.setForeground(new Color(255,255,255));
l15.setForeground(new Color(255,255,255));
l18.setForeground(new Color(255,255,255));
l19.setForeground(new Color(255,255,255));
l20.setForeground(new Color(255,255,255));
l21.setForeground(new Color(255,255,255));
l22.setForeground(new Color(255,255,255));
l23.setForeground(new Color(255,255,255));
l24.setForeground(new Color(255,255,255));
l25.setForeground(new Color(255,255,255));
l26.setForeground(new Color(255,255,255));
l29.setForeground(new Color(255,255,255));
l30.setForeground(new Color(255,255,255));
l31.setForeground(new Color(255,255,255));
//Schriftfarbe aller Labels + Textfelder Ende
//Button- Farbe Anfang
b1.setBackground(new Color(100,100,100));
b2.setBackground(new Color(100,100,100));
b3.setBackground(new Color(100,100,100));
b4.setBackground(new Color(100,100,100));
b5.setBackground(new Color(100,100,100));
b6.setBackground(new Color(100,100,100));
b7.setBackground(new Color(100,100,100));
b8.setBackground(new Color(80,80,80));
b9.setBackground(new Color(80,80,80));
b10.setBackground(new Color(100,100,100));
//Button- Farbe Ende
//Schriftfarbe Buttons Anfang
b1.setForeground(new Color(204,187,136));
b2.setForeground(new Color(204,187,136));
b3.setForeground(new Color(204,187,136));
b4.setForeground(new Color(204,187,136));
b5.setForeground(new Color(204,187,136));
b6.setForeground(new Color(204,187,136));
b7.setForeground(new Color(204,187,136));
b8.setForeground(new Color(255,255,255));
b9.setForeground(new Color(255,255,255));
b10.setForeground(new Color(204,187,136));
//Schriftfarbe Buttons Ende
//Schrifttyp Buttons Anfang
Font f5=new Font("Arial",Font.BOLD,14);
b1.setFont(f5);b2.setFont(f5);
b3.setFont(f5);b4.setFont(f5);
b5.setFont(f5);b7.setFont(f5);
b10.setFont(f5);
Font f8=new Font("MS Reference Sans Serif",Font.PLAIN,11);
b5.setFont(f8);b6.setFont(f8);b8.setFont(f8);b9.setFont(f8);
//Schrifttyp Buttons Ende
//layout ende
//Action Listener Anfang
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
b6.addActionListener(this);
b7.addActionListener(this);
b8.addActionListener(this);
b9.addActionListener(this);
b10.addActionListener(this);
suchen.addItemListener(this);
suchen.add("Benutzername");
suchen.add("ICQ- Nummer");
suchen.add("AIM");
sortieren.addItemListener(this);
sortieren.add("Benutzername");
sortieren.add("ICQ- Nummer");
sortieren.add("AIM");
//Action Listener Ende
//Layout Pulldownmenü's Anfang
sortieren.setBackground(new Color(0,0,0));
sortieren.setForeground(new Color(255,255,255));
suchen.setBackground(new Color(0,0,0));
suchen.setForeground(new Color(255,255,255));
//Layout Pulldownmenü's Ende
ta.setEditable(false);
}
void einfuegen(String benutzername,String passwort,String email,String alter,String icq,String aim,String website,String interessen)
{
int i=0;
while (!arr[i].getBenutzername().equals(""))
{i=i+1;}
arr[i].setBenutzername(benutzername);
arr[i].setPasswort(passwort);
arr[i].setEmail(email);
arr[i].setAlter(alter);
arr[i].setIcq(icq);
arr[i].setAim(aim);
arr[i].setWebsite(website);
arr[i].setInteressen(interessen);
}
void save(){
try {
PrintStream datei=new PrintStream(new FileOutputStream("benutzerdaten.txt"));
int i=0;
while (!arr[i].getBenutzername().equals("")){
String benutzername=arr[i].getBenutzername();
String passwort=arr[i].getPasswort();
String email=arr[i].getEmail();
String alter=arr[i].getAlter();
String icq=arr[i].getIcq();
String aim=arr[i].getAim();
String website=arr[i].getWebsite();
String interessen=arr[i].getInteressen();
datei.println(benutzername);
datei.println(passwort);
datei.println(email);
datei.println(alter);
datei.println(icq);
datei.println(aim);
datei.println(website);
datei.println(interessen);
i=i+1;
}
datei.close();
}
catch (Exception e){System.out.println("Fehler");}
}
void load(){
try {
DataInputStream in=new DataInputStream(new FileInputStream("benutzerdaten.txt"));
int i=0;
String line="";
while ((line=in.readLine())!=null) {
arr[i].setBenutzername(line);
line=in.readLine();
arr[i].setPasswort(line);
line=in.readLine();
arr[i].setEmail(line);
line=in.readLine();
arr[i].setAlter(line);
line=in.readLine();
arr[i].setIcq(line);
line=in.readLine();
arr[i].setAim(line);
line=in.readLine();
arr[i].setWebsite(line);
line=in.readLine();
arr[i].setInteressen(line);
i=i+1;
}
in.close();
} catch (Exception e) {}
}
void showall(){
int i=0;
String hilfe="";
while (!arr[i].getBenutzername().equals(""))
{
String benutzername=arr[i].getBenutzername();
String email=arr[i].getEmail();
String alter=arr[i].getAlter();
String icq=arr[i].getIcq();
String aim=arr[i].getAim();
String website=arr[i].getWebsite();
String interessen=arr[i].getInteressen();
hilfe=hilfe+benutzername+" ("+alter+")\nICQ: "+icq+"\nAIM: "+aim+"\nHomepage: "+website+"\nInteressen: "+interessen+"\n\n";
i=i+1;
}
ta.setText(hilfe);
}
void search_name(){
String eingabe=tf9.getText();
String hilfe="";
String benutzer="Datenbank fand folg. Benutzer:";
int i=0;
int bedingung=0;
int anzahl=0;
int tflaenge=eingabe.length();
while (!arr[i].getBenutzername().equals("")){
if(eingabe.equals(arr[i].getBenutzername())){
ta.setText(arr[i].getBenutzername()+" ("+arr[i].getAlter()+")\nICQ: "+arr[i].getIcq()+"\nAIM: "+arr[i].getAim()+"\nWebsite: "+arr[i].getWebsite()+"\nInteressen: "+arr[i].getInteressen()+"");
bedingung=1;
}
if (!eingabe.equals(arr[i].getBenutzername())&(eingabe.length()<(arr[i].getBenutzername().length()))){
anzahl=0;
hilfe="";
while (anzahl<tflaenge){
String bu=arr[i].getBenutzername().substring(anzahl,anzahl+1);
hilfe=hilfe+bu;
anzahl=anzahl+1;
}
if(hilfe.equals(eingabe)){
benutzer=benutzer+"\n- - - - -\nBenutzername: "+arr[i].getBenutzername()+"\nICQ: "+arr[i].getIcq()+"\nAIM: "+arr[i].getAim()+"";
ta.setText(benutzer);
bedingung=1;
}
if(bedingung==0){ta.setText("Benutzername existiert nicht!");}
}
i=i+1;
}
}
void search_icq(){
String eingabe=tf9.getText();
int tflaenge=eingabe.length();
int tfzahl=new Integer(eingabe).intValue();
String hilfe="";
String icq="Ähnliche ICQ- Nummern:";
int i=0;
int bedingung=0;
int anzahl=0;
while (!arr[i].getIcq().equals("")){
if(eingabe.equals(arr[i].getIcq())){
ta.setText(arr[i].getBenutzername()+" ("+arr[i].getAlter()+")\nICQ: "+arr[i].getIcq()+"\nAIM: "+arr[i].getAim()+"\nWebsite: "+arr[i].getWebsite()+"\nInteressen: "+arr[i].getInteressen()+"");
bedingung=1;
}
if (!eingabe.equals(arr[i].getIcq())&(eingabe.length()<(arr[i].getIcq().length()))){
anzahl=0;
hilfe="";
while (anzahl<tflaenge){
String bu=arr[i].getIcq().substring(anzahl,anzahl+1);
hilfe=hilfe+bu;
anzahl=anzahl+1;
}
int io=new Integer(hilfe).intValue();
if(io==tfzahl){
icq=icq+"\n- - - - -\nICQ: "+arr[i].getIcq()+"\nBenutzername: "+arr[i].getBenutzername()+"\nAIM: "+arr[i].getAim()+"";
ta.setText(icq);
bedingung=1;
}
if(bedingung==0){ta.setText("ICQ nicht bekannt!");}
}
i=i+1;
}
if (bedingung==0){ta.setText("ICQ- Nummer existiert nicht!");}
}
void search_aim(){
String eingabe=tf9.getText();
String hilfe="";
String aim="Ähnliche AIM- Namen:";
int i=0;
int bedingung=0;
int anzahl=0;
int tflaenge=eingabe.length();
while (!arr[i].getAim().equals("")){
if(eingabe.equals(arr[i].getAim())){
ta.setText(arr[i].getBenutzername()+" ("+arr[i].getAlter()+")\nICQ: "+arr[i].getIcq()+"\nAIM: "+arr[i].getAim()+"\nWebsite: "+arr[i].getWebsite()+"\nInteressen: "+arr[i].getInteressen()+"");
bedingung=1;
}
if (!eingabe.equals(arr[i].getAim())&(eingabe.length()<(arr[i].getAim().length()))){
anzahl=0;
hilfe="";
while (anzahl<tflaenge){
String bu=arr[i].getAim().substring(anzahl,anzahl+1);
hilfe=hilfe+bu;
anzahl=anzahl+1;
}
if(hilfe.equals(eingabe)){
aim=aim+"\n- - - - -\nAIM: "+arr[i].getAim()+"\nBenutzername: "+arr[i].getBenutzername()+"\nICQ: "+arr[i].getIcq()+"";
ta.setText(aim);
bedingung=1;
}
if(bedingung==0){ta.setText("AIM nicht bekannt!");}
}
i=i+1;
}
}
void sort_name(){
int anzahl=0;
while (!arr[anzahl].getBenutzername().equals(""))
{anzahl=anzahl+1;}
int bedingung=1;
while (bedingung==1)
{
int i=0;
bedingung=0;
while (i<anzahl-1)
{
if (arr[i].getBenutzername().compareTo(arr[i+1].getBenutzername())>0){
String benutzername=arr[i].getBenutzername();
String passwort=arr[i].getPasswort();
String email=arr[i].getEmail();
String alter=arr[i].getAlter();
String icq=arr[i].getIcq();
String aim=arr[i].getAim();
String website=arr[i].getWebsite();
String interessen=arr[i].getInteressen();
arr[i].setBenutzername(arr[i+1].getBenutzername());
arr[i].setPasswort(arr[i+1].getPasswort());
arr[i].setEmail(arr[i+1].getEmail());
arr[i].setAlter(arr[i+1].getAlter());
arr[i].setIcq(arr[i+1].getIcq());
arr[i].setAim(arr[i+1].getAim());
arr[i].setWebsite(arr[i+1].getWebsite());
arr[i].setInteressen(arr[i+1].getInteressen());
arr[i+1].setBenutzername(benutzername);
arr[i+1].setPasswort(passwort);
arr[i+1].setEmail(email);
arr[i+1].setAlter(alter);
arr[i+1].setIcq(icq);
arr[i+1].setAim(aim);
arr[i+1].setWebsite(website);
arr[i+1].setInteressen(interessen);
bedingung=1;
}//end of while
i=i+1;
int x=0;
String hilfe="";
while (!arr[x].getBenutzername().equals("")){
String benutzername=arr[x].getBenutzername();
String passwort=arr[x].getPasswort();
String email=arr[x].getEmail();
String alter=arr[x].getAlter();
String icq=arr[x].getIcq();
String aim=arr[x].getAim();
String website=arr[x].getWebsite();
String interessen=arr[x].getInteressen();
hilfe=hilfe+benutzername+" ("+alter+")\nICQ: "+icq+"\nAIM: "+aim+"\nHomepage: "+website+"\nInteressen: "+interessen+"\n\n";
x=x+1;
}
ta.setText(hilfe);
}
}
}
void sort_aim(){
int anzahl=0;
while (!arr[anzahl].getAim().equals(""))
{anzahl=anzahl+1;}
int bedingung=1;
while (bedingung==1){
int i=0;
bedingung=0;
while (i<anzahl-1){
if (arr[i].getAim().compareTo(arr[i+1].getAim())>0){
String benutzername=arr[i].getBenutzername();
String passwort=arr[i].getPasswort();
String email=arr[i].getEmail();
String alter=arr[i].getAlter();
String icq=arr[i].getIcq();
String aim=arr[i].getAim();
String website=arr[i].getWebsite();
String interessen=arr[i].getInteressen();
arr[i].setBenutzername(arr[i+1].getBenutzername());
arr[i].setPasswort(arr[i+1].getPasswort());
arr[i].setEmail(arr[i+1].getEmail());
arr[i].setAlter(arr[i+1].getAlter());
arr[i].setIcq(arr[i+1].getIcq());
arr[i].setAim(arr[i+1].getAim());
arr[i].setWebsite(arr[i+1].getWebsite());
arr[i].setInteressen(arr[i+1].getInteressen());
arr[i+1].setBenutzername(benutzername);
arr[i+1].setPasswort(passwort);
arr[i+1].setEmail(email);
arr[i+1].setAlter(alter);
arr[i+1].setIcq(icq);
arr[i+1].setAim(aim);
arr[i+1].setWebsite(website);
arr[i+1].setInteressen(interessen);
bedingung=1;
}//end of while
i=i+1;
int x=0;
String hilfe="";
while (!arr[x].getBenutzername().equals("")){
String benutzername=arr[x].getBenutzername();
String passwort=arr[x].getPasswort();
String email=arr[x].getEmail();
String alter=arr[x].getAlter();
String icq=arr[x].getIcq();
String aim=arr[x].getAim();
String website=arr[x].getWebsite();
String interessen=arr[x].getInteressen();
hilfe=hilfe+benutzername+" ("+alter+")\nICQ: "+icq+"\nAIM: "+aim+"\nHomepage: "+website+"\nInteressen: "+interessen+"\n\n";
x=x+1;
}
ta.setText(hilfe);
}
}
}
void sort_icq(){
int anzahl=0;
while (!arr[anzahl].getIcq().equals(""))
{anzahl=anzahl+1;}
int bedingung=1;
while (bedingung==1){
int i=0;
bedingung=0;
while (i<anzahl-1){
String nummer1=arr[i].getIcq();
String nummer2=arr[i+1].getIcq();
int icq1=new Integer(nummer1).intValue();
int icq2=new Integer(nummer2).intValue();
if (icq1==icq2){}
if (icq1<icq2){}
if (icq1>icq2){
String benutzername=arr[i].getBenutzername();
String passwort=arr[i].getPasswort();
String email=arr[i].getEmail();
String alter=arr[i].getAlter();
String icq=arr[i].getIcq();
String aim=arr[i].getAim();
String website=arr[i].getWebsite();
String interessen=arr[i].getInteressen();
arr[i].setBenutzername(arr[i+1].getBenutzername());
arr[i].setPasswort(arr[i+1].getPasswort());
arr[i].setEmail(arr[i+1].getEmail());
arr[i].setAlter(arr[i+1].getAlter());
arr[i].setIcq(arr[i+1].getIcq());
arr[i].setAim(arr[i+1].getAim());
arr[i].setWebsite(arr[i+1].getWebsite());
arr[i].setInteressen(arr[i+1].getInteressen());
arr[i+1].setBenutzername(benutzername);
arr[i+1].setPasswort(passwort);
arr[i+1].setEmail(email);
arr[i+1].setAlter(alter);
arr[i+1].setIcq(icq);
arr[i+1].setAim(aim);
arr[i+1].setWebsite(website);
arr[i+1].setInteressen(interessen);
bedingung=1;
}
i=i+1;
int x=0;
String hilfe="";
while (!arr[x].getBenutzername().equals("")){
String benutzername=arr[x].getBenutzername();
String passwort=arr[x].getPasswort();
String email=arr[x].getEmail();
String alter=arr[x].getAlter();
String icq=arr[x].getIcq();
String aim=arr[x].getAim();
String website=arr[x].getWebsite();
String interessen=arr[x].getInteressen();
hilfe=hilfe+benutzername+" ("+alter+")\nICQ: "+icq+"\nAIM: "+aim+"\nHomepage: "+website+"\nInteressen: "+interessen+"\n\n";
x=x+1;
}
ta.setText(hilfe);
}
}
}
void next(){
while (!arr[arraysize].getBenutzername().equals(""))
{arraysize=arraysize+1;}
if (arraysize==counter){counter=0;}
String angaben="";
String benutzername=arr[counter].getBenutzername();
String passwort=arr[counter].getPasswort();
String email=arr[counter].getEmail();
String alter=arr[counter].getAlter();
String icq=arr[counter].getIcq();
String aim=arr[counter].getAim();
String website=arr[counter].getWebsite();
String interessen=arr[counter].getInteressen();
angaben=benutzername+" ("+alter+")\nICQ: "+icq+"\nAIM: "+aim+"\nHomepage: "+website+"\nInteressen: "+interessen+"\n\n";
ta.setText(""+angaben);
}
void previous(){
while (!arr[arraysize].getBenutzername().equals(""))
{arraysize=arraysize+1;}
if (counter==-1){counter=arraysize-1;}
String angaben="";
String benutzername=arr[counter].getBenutzername();
String passwort=arr[counter].getPasswort();
String email=arr[counter].getEmail();
String alter=arr[counter].getAlter();
String icq=arr[counter].getIcq();
String aim=arr[counter].getAim();
String website=arr[counter].getWebsite();
String interessen=arr[counter].getInteressen();
angaben=benutzername+" ("+alter+")\nICQ: "+icq+"\nAIM: "+aim+"\nHomepage: "+website+"\nInteressen: "+interessen+"\n\n";
ta.setText(""+angaben);
}
void login(){
String tf1=tf10.getText();
String tf2=tf11.getText();
int i=0;
int bedingung=0;
while (!arr[i].getBenutzername().equals("")){
if(tf1.equals(arr[i].getBenutzername())&tf2.equals(arr[i].getPasswort())){
//user win=new user();
//win.resize(800,800);
//win.show();
bedingung=1;
tf10.setText("Super");
tf11.setText("Super");
}
else{ if(!tf1.equals(arr[i].getBenutzername())&!tf2.equals(arr[i].getPasswort())){
tf10.setText("Bitte überprüfen");
tf11.setText("Bitte überprüfen");
else {hier bin ich gerade am arbeiten}
}
}//end of else
i=i+1;
}
}
public static void main(String argv[]) {
benutzeranmeldung kon=new benutzeranmeldung();
kon.resize(1000,800);
kon.show();
}
}