[Projekte] von Ironlors

  • Akten tool
    1. Idee (ActionListener)

    Spoiler anzeigen
    Code
    buttonGrief.addActionListener (new ActionListener(){ public void actionPerformed (ActionEvent avt){ /* a = Strafe e = Name c = Menge titel = [JF-Akte] <User> tat = <User> hat <Menge> gegrief menge = <Menge> strafe = <Jail> <Menge>*400=<Strafe> d = <jailtime> */ buttonGrief_ActionPerformed(evt); String e = textFieldName.getText(); int c = numberFieldMenge.getInt(); int a = c*400; new String titel=("[JF-Akte] "+e+"\n"); new String tat=(e+"hat "+c+" nicht gegrieft\n"); new String menge=("Menge: "+c+"\n"); new String strafe=(d+" , "+c+"*400="+a+"\n"); if(c>=2 && c<=10) { String d = ("Strafe: 30min Jail\n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(strafe+"\n"); } if(c>=11 && c<=20) { String d = ("Strafe: 60min Jail\n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(strafe+"\n"); } if(c>=21 && c<=30) { String d = ("Strafe: 120min Jail\n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(strafe+"\n"); } if(c>=31 && c<=40) { String d = ("Strafe: 200min Jail\n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(strafe+"\n"); } if(c>=41 && c<=50) { String d = ("Strafe: 200min Jail\n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(strafe+"\n"); } if(c>=51 && c<=60) { String d = ("Strafe: 1 Tag Bann – 1 Woche Bann\n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(strafe+"\n"); } if(c>=61 && c<=199) { String d = ("Strafe: 1 Woche Bann – 1 Monat Bann\n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(strafe+"\n"); } if(c>=200 && c<=299) { String d = ("Strafe: 1 Monat Bann – Perma Bann \n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(strafe+"\n"); } if(c>=300) { String d = ("Perma Bann\n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(strafe+"\n"); } } } buttonPflanzen.addActionListener (new ActionListener(){ public void actionPerformed (ActionEvent avt){ /* a = Strafe e = Name c = Menge titel = [JF-Akte] <User> tat = <User> hat <Menge> nicht nach gepflanzt menge = <Menge> strafe = <Jail> <Menge>*400=<Strafe> d = <jailtime> */ buttonGrief_ActionPerformed(evt); String e = textFieldName.getText(); int c = numberFieldMenge.getInt(); int a = c*100; new String titel=("[JF-Akte] "+e+"\n"); new String tat=(e+"hat "+c+" nicht nachgepflanzt\n"); new String menge=("Menge: "+c+"\n"); new String strafe=(d+" , "+c+"*100="+a+"\n"); textAreaAkte.append(titel+"\n"); textAreaAkte.append(tat+"\n"); textAreaAkte.append(menge+"\n"); textAreaAkte.append(strafe+"\n"); } }

    Der fertige Code

    Spoiler anzeigen

    „We are Anonymous.
    We are Legion.
    We do not forgive.
    We do not forget.
    Expect us.“

    6 Mal editiert, zuletzt von Ironlors (27. Oktober 2013 um 18:17)

  • Hello World

    Spoiler anzeigen
    Code
    /* * author Kay Kleinvogel * Version 1.0.0 * Dies ist meistens das erste Programm beim erlernen einer neuen Programmiersprache */public class HelloWorld {	public static void main(String args[]){//Hello WorldSystem.out.println("Hello World!"); 	}}


    Taschenrechner(working Progress) Vollständiger Code [Download]

    Spoiler anzeigen

    „We are Anonymous.
    We are Legion.
    We do not forgive.
    We do not forget.
    Expect us.“

    4 Mal editiert, zuletzt von Ironlors (27. Oktober 2013 um 18:26)

  • In Zeile 19/20 hast du für numberFieldMenge.getInt() eine eigene Variable erstellt. Du kannst das auch direkt aneinanderreihen:

    Code
    int x = numberFieldMenge.getInt()*400

    Tatsächlich hab ich in meiner Polizistenzeit ebenfalls sowas geschrieben !
    Ich habe für jeden Block eine eigene Variable erstellt ^^ War `ne heiden Arbeit. Aber letztendlich hat es auch funktioniert und es kam immer eine komplett brauchbare Akte bei raus :)
    Leider hab ich es nie geschafft es für 1.6 ready zu machen so dass es jetzt auf der Platte vergammelt :1

  • In Zeile 19/20 hast du für numberFieldMenge.getInt() eine eigene Variable erstellt. Du kannst das auch direkt aneinanderreihen:

    Code
    int x = numberFieldMenge.getInt()*400

    Tatsächlich hab ich in meiner Polizistenzeit ebenfalls sowas geschrieben !
    Ich habe für jeden Block eine eigene Variable erstellt ^^ War `ne heiden Arbeit. Aber letztendlich hat es auch funktioniert und es kam immer eine komplett brauchbare Akte bei raus :)
    Leider hab ich es nie geschafft es für 1.6 ready zu machen so dass es jetzt auf der Platte vergammelt :1

    gute Idee ich, dass ist so das Ideal welches ich (irgend wann) erreichen möchte.
    Hier mal der fertige Code
    Habe deine Idee nicht umgesetzt, da ich persöhnlich es so wie ich es habe übersichtlicher finde.

    „We are Anonymous.
    We are Legion.
    We do not forgive.
    We do not forget.
    Expect us.“

    2 Mal editiert, zuletzt von Ironlors (27. Oktober 2013 um 18:18)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!