Results 1 to 5 of 5
  1. #1
    khp
    khp is offline Member
    Join Date
    Jun 2009
    Posts
    3
    Rep Power
    0

    Question compiling .java into .class

    Hi there,

    I have a serious problem with java. I'm a real beginner, but I have to change some things for our research-website. The person who made all the java applets isn't there any more, so I cannot ask him.
    The problem: I have a applet made like the WINexplorer. You can click on seveal file-names and a linked HTML-site opens. The problem is that the HTML-site opens in the same window, but it should always open in a new one. That's not the problem I added "_blank" in the source code at the showdocument-order. I think that should work.
    But it is not possible to compile the java file into class anymore, even if there was no change made. There are several errors. Pherhaps I should say, that I first recompiled the .class file into .java, made the little change or not and then wanted to compile it again. Doesn't fit. :confused:
    Can somebody help me, because it's really important.

    Java Code:
    package Uebersicht2;
    
    import com.borland.jbcl.layout.VerticalFlowLayout;
    import java.applet.Applet;
    import java.applet.AppletContext;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.FlowLayout;
    import java.awt.Font;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.io.PrintStream;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.Stack;
    import java.util.Vector;
    import javax.swing.BorderFactory;
    import javax.swing.Box;
    import javax.swing.Icon;
    import javax.swing.JApplet;
    import javax.swing.JComponent;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.UIManager;
    import javax.swing.border.Border;
    import javax.swing.border.TitledBorder;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.TreePath;
    import javax.swing.tree.TreeSelectionModel;
    
    public class Uebersicht2 extends JApplet
    {
      boolean isStandalone = false;
      JLabel text;
      Vector bereich = new Vector();
      JScrollPane jsp;
      Box ob;
      String Bereichsname = "";
      int Benutzernummer = -1;
      int aktuelleSeite = -1;
      int AnzahlKapitel = 0;
      int AufrufKapitelNummer = -1;
      JTree baum;
      Vector NodeType = new Vector();
      private String info = "Lehrstuhl für Mathematik und Didaktik der Chemie, Universität Bayreuth";
      private String pm;
      private boolean printInfos = false;
      private boolean oeffneAktKapGanz = false;
      private MyIcon temp = new MyIcon();
      private Icon my_icon_leaf_visited = new MyIcon(Color.yellow, Color.black, this.temp.getSmile(), 14);
      private Icon my_icon_leaf_actual = new MyIcon(Color.green, Color.black, this.temp.getHalfSmile(), 12);
      private Icon my_icon_leaf_unvisited = new MyIcon(Color.orange, Color.black, this.temp.getNoSmile(), 10);
      private String JB_getCodeBase;
      private String Benutzerdaten = new String("");
      private String Seitendaten = new String("");
      private String aufruf;
      private String found;
      private String aktSeiteParameter = "-pg";
      JLabel Icon1;
      JLabel Icon2;
      JLabel Icon3;
      TitledBorder titledBorder1;
      JPanel jPanel1;
      JPanel jPanel2;
      JScrollPane head;
      JPanel foot = new JPanel();
      JLabel jLabel1 = new JLabel();
      FlowLayout flowLayout1 = new FlowLayout();
      JPanel jPanel3 = new JPanel();
      VerticalFlowLayout verticalFlowLayout1 = new VerticalFlowLayout();
      JLabel jLabel2 = new JLabel();
      TitledBorder titledBorder2;
      Border myBorder1;
      Border myBorder2;
    
      private String connectingWWWPath(String s1, String s2)
      {
        int merkAnzahl = 0;
        while (s2.startsWith("."))
          if (s2.startsWith("./")) {
            s2 = s2.substring(2);
          }
          else if (s2.startsWith("../")) {
            s2 = s2.substring(3);
            ++merkAnzahl;
          }
          else {
            s2 = s2.substring(s2.indexOf("/", 0) + 1);
            ++merkAnzahl;
          }
    
        for (int i = 0; i < merkAnzahl; ++i) {
          int j = s1.lastIndexOf("/");
          if (j > -1)
            s1 = s1.substring(0, j);
        }
    
        return String.valueOf(String.valueOf(s1).concat(String.valueOf("/"))).concat(String.valueOf(s2));
      }
    
      public void init()
      {
        String myLookAndFeel = UIManager.getSystemLookAndFeelClassName();
        try {
          UIManager.setLookAndFeel(myLookAndFeel);
        }
        catch (Exception localException1)
        {
        }
    
        this.text = new JLabel();
        this.jsp = new JScrollPane();
        Vector NodeType = new Vector();
        this.Icon1 = new JLabel();
        this.Icon2 = new JLabel();
        this.Icon3 = new JLabel();
        this.jPanel1 = new JPanel();
        this.jPanel2 = new JPanel();
        this.head = new JScrollPane();
        try
        {
          jbInit();
        }
        catch (Exception e) {
          e.printStackTrace();
        }
      }
    
      private void jbInit()
        throws Exception
      {
        this.pm = getMyParameter("printInfos");
        if (this.pm == null) this.pm = new String("no");
        this.printInfos = (this.pm.compareTo("yes") == 0);
    
        this.pm = getMyParameter("Hintergrundfarbe");
        if (this.pm == null) this.pm = new String("F9F7C8");
        MyColors jbf = new MyColors();
        MyColors.BGColor = jbf.toColor(this.pm);
        MyColors.BackgroundNonSelectionColor = MyColors.BGColor;
    
        this.pm = getMyParameter("HintergrundfarbeKopf");
        if (this.pm == null) MyColors.BGColorBereich = MyColors.BGColor;
        else { MyColors.BGColorBereich = jbf.toColor(this.pm);
        }
    
        this.ob = Box.createHorizontalBox();
    
        this.titledBorder2 = new TitledBorder("");
        this.myBorder1 = BorderFactory.createLineBorder(new Color(253, 243, 176), 2);
        this.myBorder2 = BorderFactory.createLineBorder(new Color(253, 243, 176), 2);
    
        this.ob.setBackground(MyColors.BGColor);
    
        this.text.setFont(new Font("Roman", 1, 16));
    
        this.text.setForeground(MyColors.ForeColor);
        this.Icon1.setBackground(MyColors.BGColor);
        this.Icon1.setForeground(MyColors.ForeColor);
        this.Icon1.setHorizontalAlignment(4);
        this.Icon1.setText("besuchte Seite");
        this.Icon1.setIcon(this.my_icon_leaf_visited);
        this.Icon2.setForeground(MyColors.ForeColor);
        this.Icon2.setBackground(MyColors.BGColor);
        this.Icon2.setHorizontalAlignment(4);
        this.Icon2.setText("aktuelle Seite");
        this.Icon2.setIcon(this.my_icon_leaf_actual);
        this.Icon3.setForeground(MyColors.ForeColor);
        this.Icon3.setBackground(MyColors.BGColor);
        this.Icon3.setHorizontalAlignment(4);
        this.Icon3.setText("nicht besuchte Seite");
        this.Icon3.setIcon(this.my_icon_leaf_unvisited);
    
        this.jPanel2.setLayout(this.verticalFlowLayout1);
        this.jPanel1.setLayout(this.flowLayout1);
        this.head.getViewport().setBackground(MyColors.BGColor);
        this.head.setAlignmentX(0.0F);
        this.head.setAlignmentY(0.0F);
        this.head.setBorder(null);
        this.jsp.getViewport().setBackground(MyColors.BGColor);
        this.jsp.setBorder(this.myBorder1);
        this.foot.setBackground(MyColors.BGColor);
    
        this.jLabel1.setFont(new Font("Dialog", 0, 10));
        this.jLabel1.setHorizontalAlignment(0);
        this.jLabel1.setText("Informationen über besuchte Seiten erhalten nur eingeloggte Benutzer!");
        this.jLabel2.setText("                    ");
        super.getContentPane().add(this.jsp, "Center");
        super.getContentPane().add(this.head, "North");
        this.head.getViewport().add(this.jPanel1, null);
        this.jPanel1.add(this.text, null);
        this.jPanel1.add(this.jLabel2, null);
        this.jPanel1.add(this.jPanel2, null);
        this.jPanel2.add(this.jPanel3, null);
        this.jPanel3.add(this.Icon1, null);
        this.jPanel3.add(this.Icon2, null);
        this.jPanel3.add(this.Icon3, null);
        this.jPanel2.add(this.jLabel1, null);
    
        this.jPanel1.setBackground(MyColors.BGColorBereich);
        this.jPanel2.setBackground(MyColors.BGColorBereich);
        this.jPanel3.setBackground(MyColors.BGColorBereich);
    
        super.getContentPane().add(this.foot, "South");
    
        this.jsp.getViewport().add(this.ob, null);
    
        this.jsp.getViewport().add(this.ob, null);
        super.getContentPane().setBackground(MyColors.BGColor);
    
        this.JB_getCodeBase = getDocumentBase().toString();
        this.JB_getCodeBase = this.JB_getCodeBase.substring(0, this.JB_getCodeBase.lastIndexOf(47));
    
        this.pm = getMyParameter("Gast");
        if (this.pm == null) this.pm = new String("");
        for (int i = 0; i < this.pm.length(); ++i) {
          this.NodeType.insertElementAt(this.pm.substring(i, i + 1), i);
        }
    
        this.pm = getMyParameter("Benutzerdaten");
        if ((this.pm != null) && (this.pm.compareTo("-1") != 0))
          this.Benutzerdaten = this.pm;
        else {
          this.Benutzerdaten = new String("");
        }
    
        this.pm = getMyParameter("Seitendaten");
        if ((this.pm != null) && (this.pm.compareTo("-1") != 0))
          this.Seitendaten = this.pm;
        else {
          this.Seitendaten = new String("");
        }
    
        this.pm = getMyParameter("Benutzernummer");
        try {
          if (this.pm != null) this.Benutzernummer = Integer.parseInt(this.pm, 10);
          this.pm = getMyParameter("aktuelleSeite");
        }
        catch (NumberFormatException e) {
          this.Benutzernummer = -1;
        }
        try {
          if (this.pm != null) this.aktuelleSeite = Integer.parseInt(this.pm, 10);
        }
        catch (NumberFormatException e) {
          this.aktuelleSeite = -1;
        }
    
        this.pm = getMyParameter("oeffneAktKapGanz");
        if (this.pm == null) this.pm = new String("no");
        this.oeffneAktKapGanz = (this.pm.compareTo("yes") == 0);
    
        this.pm = getMyParameter("Bereichsname");
        if (this.pm == null) this.pm = new String("noname");
        this.Bereichsname = this.pm;
        this.text.setText(this.Bereichsname);
    
        this.pm = getMyParameter("AnzahlKapitel");
        if (this.pm == null) this.pm = new String("0");
        this.AnzahlKapitel = Integer.parseInt(this.pm);
        for (i = 0; i < this.AnzahlKapitel; ++i) {
          this.bereich.add(i, new JScrollPane());
        }
    
        this.pm = getMyParameter("AufrufKapitelNummer");
        if (this.pm == null) this.AufrufKapitelNummer = -1;
        else { this.AufrufKapitelNummer = Integer.parseInt(this.pm);
        }
    
        for (i = 0; i < this.AnzahlKapitel; ++i) {
          int anzahlVorher;
          int anzahlNachher;
          int k;
          this.ob.add((JScrollPane)this.bereich.elementAt(i), null);
          ((JScrollPane)this.bereich.elementAt(i)).setBackground(MyColors.BGColor);
          ((JScrollPane)this.bereich.elementAt(i)).setBorder(this.myBorder2);
          this.pm = getMyParameter(new String(String.valueOf("Kapitel_").concat(String.valueOf(new String(Integer.toString(i))))));
    
          if (this.pm == null) this.pm = new String("Error()");
          JTree baum = new JTree();
          baum = zuBaum(this.pm);
    
          baum.setBackground(MyColors.BGColor);
          baum.getSelectionModel().setSelectionMode(1);
    
          baum.putClientProperty("JTree.lineStyle", "Angled");
          baum.setShowsRootHandles(true);
          baum.setRootVisible(true);
    
          JTree pointerbaum = baum;
          MouseListener ml = new MouseAdapter(pointerbaum) { private final JTree val$pointerbaum;
    
            public void mouseClicked(MouseEvent e) { int selRow = this.val$pointerbaum.getRowForLocation(e.getX(), e.getY());
              TreePath selPath = this.val$pointerbaum.getPathForLocation(e.getX(), e.getY());
              if (selRow != -1)
                if (e.getClickCount() == 1)
                  if (!(((UKZ)selPath.getLastPathComponent()).isFolder()))
                  {
                    if (Uebersicht2.access$0(Uebersicht2.this).length() > 2)
                    {
                      Uebersicht2.access$1(Uebersicht2.this, ((UKZ)selPath.getLastPathComponent()).getURL().toString());
                      Uebersicht2.access$2(Uebersicht2.this, String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(Uebersicht2.access$0(Uebersicht2.this)).concat(String.valueOf(Uebersicht2.access$3(Uebersicht2.this)))).concat(String.valueOf(Uebersicht2.access$4(Uebersicht2.this)))).concat(String.valueOf("__bL"))).concat(String.valueOf(Uebersicht2.access$5(Uebersicht2.this)))).concat(String.valueOf("__bR")));
    
                      int iDot = Uebersicht2.access$6(Uebersicht2.this).indexOf(".");
                      while (iDot > -1) {
                        Uebersicht2.access$2(Uebersicht2.this, String.valueOf(String.valueOf(Uebersicht2.access$6(Uebersicht2.this).substring(0, iDot)).concat(String.valueOf("__dot"))).concat(String.valueOf(Uebersicht2.access$6(Uebersicht2.this).substring(iDot + 1, Uebersicht2.access$6(Uebersicht2.this).length()))));
    
                        iDot = Uebersicht2.access$6(Uebersicht2.this).indexOf(".");
                      }
    
                      Uebersicht2.access$2(Uebersicht2.this, String.valueOf(String.valueOf(String.valueOf(String.valueOf(Uebersicht2.access$7(Uebersicht2.this)).concat(String.valueOf("/"))).concat(String.valueOf("asB.pl"))).concat(String.valueOf("?"))).concat(String.valueOf(Uebersicht2.access$6(Uebersicht2.this))));
                      try
                      {
                        if (Uebersicht2.access$8(Uebersicht2.this)) System.out.println(String.valueOf("show URL: ").concat(String.valueOf(Uebersicht2.access$6(Uebersicht2.this))));
                        URL url = new URL(Uebersicht2.access$6(Uebersicht2.this));
                        Uebersicht2.this.getAppletContext().showDocument(url);
                      }
                      catch (MalformedURLException murle) {
                        System.out.println(String.valueOf(String.valueOf("Aufruf ").concat(String.valueOf(murle.toString()))).concat(String.valueOf(" nicht moeglich.")));
                      }
                    }
                    else
                    {
                      if (Uebersicht2.access$8(Uebersicht2.this)) System.out.println(String.valueOf("show URL: ").concat(String.valueOf(((UKZ)selPath.getLastPathComponent()).getURL())));
                      Uebersicht2.this.getAppletContext().showDocument(((UKZ)selPath.getLastPathComponent()).getURL());
                    }
    
                  }
    
                else if (e.getClickCount() == 2);
    
            }
    
          };
          pointerbaum.addMouseListener(ml);
    
          UKZrenderer renderer = new UKZrenderer();
    
          baum.setCellRenderer(renderer);
    
          if (this.AufrufKapitelNummer != i) {
            if (this.AufrufKapitelNummer == -1) {
              anzahlVorher = -1; anzahlNachher = baum.getRowCount();
              while (anzahlVorher != anzahlNachher) {
                for (k = anzahlVorher; k < anzahlNachher; ++k)
                  baum.expandRow(k);
    
                anzahlVorher = anzahlNachher;
                anzahlNachher = baum.getRowCount();
              }
            } else {
              baum.collapseRow(0);
            }
          }
          else if (this.oeffneAktKapGanz)
          {
            anzahlVorher = -1; anzahlNachher = baum.getRowCount();
            while (anzahlVorher != anzahlNachher) {
              for (k = anzahlVorher; k < anzahlNachher; ++k)
                baum.expandRow(k);
    
              anzahlVorher = anzahlNachher;
              anzahlNachher = baum.getRowCount();
            }
          }
          else {
            baum.expandRow(0);
            baum.setSelectionRow(0);
          }
    
          ((JScrollPane)this.bereich.elementAt(i)).getViewport().add(baum, null);
        }
      }
    
      public String getAppletInfo()
      {
        return "Applet-Information";
      }
    
      public String[][] getParameterInfo()
      {
        return null;
      }
    
      public String getMyParameter(String key)
      {
        String got_value = getParameter(key);
        if (this.printInfos)
          if (got_value != null) {
            System.out.println(String.valueOf(String.valueOf(String.valueOf("reading ").concat(String.valueOf(key))).concat(String.valueOf(": "))).concat(String.valueOf(got_value)));
          }
          else
            System.out.println(String.valueOf(String.valueOf("reading ").concat(String.valueOf(key))).concat(String.valueOf(": <no value>")));
    
    
        return got_value;
      }
    
      public String getParameter(String key, String def)
      {
        return ((getParameter(key) != null) ? getParameter(key) : (this.isStandalone) ? System.getProperty(key, def) : def);
      }
    
      private Vector getSeitenParameter(String knoteninfo)
      {
        Vector zurueck = new Vector();
    
        String info = new String(String.valueOf(knoteninfo).concat(String.valueOf("[;]")));
    
        int begin_of_Zusatz = 0; int begin_of_URL = 0; int begin_of_END = 0;
        begin_of_Zusatz = info.indexOf(91, 0);
        begin_of_URL = info.indexOf(59, begin_of_Zusatz);
        begin_of_END = info.indexOf(93, begin_of_URL + 1);
        zurueck.addElement(info.substring(0, begin_of_Zusatz).trim());
        zurueck.addElement(info.substring(begin_of_Zusatz + 1, begin_of_URL).trim());
        zurueck.addElement(info.substring(begin_of_URL + 1, begin_of_END).trim());
    
        if ((begin_of_END - begin_of_URL > 4) && 
          (zurueck.elementAt(2).toString().substring(0, 4).toUpperCase() != "HTTP")) {
          zurueck.setElementAt(connectingWWWPath(this.JB_getCodeBase, (String)zurueck.elementAt(2)), 2);
        }
    
        return zurueck;
      }
    
      private int toNodeType(int nummer)
      {
        UKZ temp = new UKZ();
        int zurueck = temp.getIsNotVisited();
        if ((nummer < 0) || (nummer > this.NodeType.size() - 1)) {
          zurueck = temp.getIsNotVisited();
        }
        else
          switch (Integer.parseInt((String)this.NodeType.elementAt(nummer)))
          {
          case 0:
            zurueck = temp.getIsNotVisited();
            break;
          case 1:
            zurueck = temp.getIsVisited();
            break;
          default:
            zurueck = temp.getIsNotVisited();
          }
    
    
        if (nummer == this.aktuelleSeite) {
          zurueck = temp.getIsActual();
          if (this.printInfos) System.out.println(String.valueOf("found actual page: ").concat(String.valueOf(Integer.toString(nummer))));
        }
        return zurueck;
      }
    
      private JTree zuBaum(String baum)
      {
        Stack path = new Stack();
    
        UKZ root = new UKZ();
        UKZ jbaum = new UKZ();
    
        int aktPos = 0; int aktPos2 = -1; boolean rootSet = false;
        do
        {
          UKZ aktUK;
          Vector SeitenParameter;
          aktPos = aktPos2 + 1;
          switch (getNaechstesSteuerzeichen(baum.substring(aktPos)))
          {
          case '(':
            aktPos2 = baum.indexOf(40, aktPos);
            SeitenParameter = new Vector(getSeitenParameter(baum.substring(aktPos, aktPos2)));
            jbaum = new UKZ((String)SeitenParameter.get(0), (String)SeitenParameter.get(2), true);
            if (rootSet) ((UKZ)path.peek()).insert(jbaum, ((UKZ)path.peek()).getChildCount());
            path.push(jbaum);
    
            break;
          case ')':
            aktPos2 = baum.indexOf(41, aktPos);
            if (aktPos >= aktPos2)
            {
              jbaum = (UKZ)path.pop();
            }
            else {
              SeitenParameter = new Vector(getSeitenParameter(baum.substring(aktPos, aktPos2)));
              aktUK = new UKZ((String)SeitenParameter.get(0), (String)SeitenParameter.get(2), toNodeType(Integer.parseInt((String)SeitenParameter.get(1))));
              jbaum = (UKZ)path.pop();
    
              jbaum.insert(aktUK, jbaum.getChildCount()); }
            break;
          case ',':
            aktPos2 = baum.indexOf(44, aktPos);
            if (aktPos >= aktPos2)
              break label415:
    
            SeitenParameter = new Vector(getSeitenParameter(baum.substring(aktPos, aktPos2)));
            aktUK = new UKZ((String)SeitenParameter.get(0), (String)SeitenParameter.get(2), toNodeType(Integer.parseInt((String)SeitenParameter.get(1))));
            jbaum = (UKZ)path.peek();
            jbaum.insert(aktUK, jbaum.getChildCount());
            break;
          case '*':
          case '+':
          default:
            aktPos2 = baum.length() + 1;
          }
    
          if (rootSet == false) {
            label415: root = jbaum; rootSet = true;
          }
        }
        while (aktPos < baum.length());
    
        return new JTree(root);
      }
    
      private char getNaechstesSteuerzeichen(String s)
      {
        int l = s.length();
        char toReturn = ' ';
    
        int ll = s.indexOf(40, 0); if ((ll >= 0) && (ll < l)) { l = ll; toReturn = '('; }
        ll = s.indexOf(41, 0); if ((ll >= 0) && (ll < l)) { l = ll; toReturn = ')'; }
        ll = s.indexOf(44, 0); if ((ll >= 0) && (ll < l)) { l = ll; toReturn = ',';
        }
        return toReturn;
      }
    
      static String access$4(Uebersicht2 x$0)
      {
        return x$0.aktSeiteParameter; } 
      static String access$1(Uebersicht2 x$0, String x$1) { return (x$0.found = x$1); } 
      static String access$5(Uebersicht2 x$0) { return x$0.found; } 
      static String access$2(Uebersicht2 x$0, String x$1) { return (x$0.aufruf = x$1); } 
      static String access$6(Uebersicht2 x$0) { return x$0.aufruf; } 
      static String access$3(Uebersicht2 x$0) { return x$0.Seitendaten; } 
      static String access$0(Uebersicht2 x$0) { return x$0.Benutzerdaten; } 
      static String access$7(Uebersicht2 x$0) { return x$0.JB_getCodeBase; } 
      static boolean access$8(Uebersicht2 x$0) { return x$0.printInfos;
      }
    
      static
      {
        try
        {
          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }
        catch (Exception localException)
        {
        }
      }
    }
    The first error says:
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 497: ';' expected
    break label415:
    ^
    Then I added the ; at break and next 14 errors occured:

    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 265: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    for (i = 0; i < this.AnzahlKapitel; ++i) {
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 265: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    for (i = 0; i < this.AnzahlKapitel; ++i) {
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 265: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    for (i = 0; i < this.AnzahlKapitel; ++i) {
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 266: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    this.bereich.add(i, new JScrollPane());
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 274: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    for (i = 0; i < this.AnzahlKapitel; ++i) {
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 274: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    for (i = 0; i < this.AnzahlKapitel; ++i) {
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 274: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    for (i = 0; i < this.AnzahlKapitel; ++i) {
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 278: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    this.ob.add((JScrollPane)this.bereich.elementAt(i) , null);
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 279: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    ((JScrollPane)this.bereich.elementAt(i)).setBackgr ound(MyColors.BGColor);
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 280: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    ((JScrollPane)this.bereich.elementAt(i)).setBorder (this.myBorder2);
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 281: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    this.pm = getMyParameter(new String(String.valueOf("Kapitel_").concat(String.va lueOf(new String(Integer.toString(i))))));
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 295: cannot find symbol
    symbol : constructor MouseAdapter(javax.swing.JTree)
    location: class java.awt.event.MouseAdapter
    MouseListener ml = new MouseAdapter(pointerbaum) { private final JTree val$pointerbaum;
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 345: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    if (this.AufrufKapitelNummer != i) {
    ^
    C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java: 375: cannot find symbol
    symbol : variable i
    location: class Uebersicht2.Uebersicht2
    ((JScrollPane)this.bereich.elementAt(i)).getViewpo rt().add(baum, null);
    ^
    Note: C:\molis2\uebersicht\Uebersicht2\Uebersicht2.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    14 errors

    Process completed.
    .
    Please explain it as easy as you can, because I'm a java beginner :o

    Thanks a lot
    khp
    Last edited by khp; 06-29-2009 at 11:53 AM.

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

    Default

    you need to declare variable i in methods like jbInit

    it is a problem of variable scope

  3. #3
    khp
    khp is offline Member
    Join Date
    Jun 2009
    Posts
    3
    Rep Power
    0

    Default

    Thank you very much for your quick answer. I have no idea how I can do that. Could you give me more details how to declare the variable i?

  4. #4
    arthik_babu is offline Member
    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0

    Default

    Declare int variable as int i;

  5. #5
    khp
    khp is offline Member
    Join Date
    Jun 2009
    Posts
    3
    Rep Power
    0

    Default

    Ok, thanks. That was it. Now I've the .class-file.
    Another question: Now a new window opens, each time I click on a linked file. That's perfect. But the window doesn't open directly, it opens minimized in the task-line of WIN. Is it possible that the window opens automaticly when clicking on the link?
    Here's a bit of the code:
    try{
    if (printInfos) System.out.println("show URL: "+aufruf);
    URL url = new URL(aufruf);
    getAppletContext().showDocument(url);
    }
    catch(MalformedURLException murle) {
    System.out.println("Aufruf " + murle.toString() + " nicht moeglich.");
    }

    }
    else {
    if (printInfos) System.out.println("show URL: "+((UKZ) selPath.getLastPathComponent()).getURL());
    getAppletContext().showDocument(((UKZ) selPath.getLastPathComponent()).getURL(), "_blank");
    }
    }
    Has somebody an idea??
    Thanks a lot

Similar Threads

  1. not compiling a copy of class -
    By itaipee in forum Eclipse
    Replies: 0
    Last Post: 01-07-2009, 10:47 AM
  2. Compiling a single class
    By ROSOBORONEXPORTCORP in forum New To Java
    Replies: 2
    Last Post: 01-28-2008, 01:27 PM
  3. Compiling a class in a package from cmd
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 11:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •