Auf Thema antworten

Hallo alle zusammen,


ich habe Probleme mit eine If-Anweisung in meinem Programm. Mein Programm schreibe ich in Eclipse, dort bekomme ich bei meine dem "else" meiner If-Anweisung folgende Fehlermeldung:

[code]Syntax error on token "else", delete this token[/code]

Mein Quellcode sieht wie folgt aus:

[code=Java]try

    {

     Properties properties2 = new Properties();

     FileInputStream in = new FileInputStream("einstellungen.properties");

     properties2.load(in);

     if(string == (properties2.getProperty("Passwort")));

     dialog4.dispose();

      else

      final JDialog dialog5 = new JDialog();

      dialog5.setLocation(700, 375);

      dialog5.setSize(200, 150);

      dialog5.setTitle("Passwort falsch");

      dialog5.setVisible(true);

      label = new JLabel("Das eingegebene Passwort ist falsch");

      Panel panel4 = new JPanel();

      JButton button3 = new JButton("Erneut versuchen");

      button3.addActionListener(new ActionListener()

      {

       public void actionPerformed(ActionEvent ev)

       {

      dialog5.dispose();

       }

      }

      );

      panel4.add(button3);

      dialog5.add(panel4, BorderLayout.SOUTH);

      dialog5.add(label, BorderLayout.CENTER);

    }

    catch(Exception e)

    {

     e.printStackTrace();

    }[/code]


Ich verstehe nicht, warum Eclipse das "else" weghaben will, ich brauche es doch für meine If-Anweisung, was kann ich tun, um dieses Problem zu umgehen?


lg IwiS



Oben