NullPointerException wegen JPanel oder doch nicht ?

Guten Abend die Herren,

ich weiß nicht wie ich mein Problem beschreiben soll, außer dass ich normalerweise solche Probleme nicht habe. Deshalb weiß ich nicht, ob es daran liegt, dass ich seit Kurzem mit JPanel und paintComponent() arbeite oder nicht...

Eigentlich möchte ich nur ein Objekt in einer Klasse von mehreren Methoden verändern lassen, was wiederum bedeutet, dass alle Methoden auf dieses Objekt zugreifen können müssen.

Nur irgendwie kapiert meine paintComponent()-Methode das nicht ...

Hab schon mit dem Debugger nachgeschaut, sobald der Compiler in paintComponent() springt, meint er, alle meine Objekte seien "null". Alle anderen Methoden können wie gewohnt auf das Objekt zugreifen.

Die if-Abfrage dort dient nur dazu da, dass die paintComponent() erst ganz durchgeführt werden kann, wenn ich auch dem Objekt in einer anderen Methode einen Wert zugewiesen habe, und in dieser die Bedingung wahr werden lassen habe... aber keines von beidem kriege ich hin :-(

Java:
import java.io.*;
public class Irrgartenspiel
{
  public static void main(String[] args) throws FileNotFoundException, IOException
  {
    Player player1 = new Player();
    player1.play();
  }
}

Java:
import java.io.*;
public class Player
{
  char[][] maze;
  int[] startLoc;
  int[] destLoc;
  VisualPanel panel;
  
  public Player() throws FileNotFoundException, IOException
  {
    Maze m = new Maze();
    maze = m.getMaze();
    startLoc = m.getStartLoc();
    destLoc = m.getDestLoc();
  }
  public void play() throws FileNotFoundException, IOException
  {
    Tracking t = new Tracking(maze,startLoc,destLoc);
    Visual v = new Visual();
    int count = 0;    
    while (!t.hitDest()) 
    { 
      t.checkPossDirect();
      v.draw(t.getCurrLoc());
      t.move();
      count++;      
    } // end of while
    System.out.println("Schritte: " + count);
  }
}

Java:
import java.util.ArrayList;

public class Tracking
{
  char[][] maze;
  int[] currLoc;
  int[] destLoc;
  boolean[] possDirect = new boolean[4]; //0 = links, 1 = oben, 2 = rechts, 3 = unten
  ArrayList<Location> moveList = new ArrayList<Location>();
  int countBackTrack = 0;
  
  public Tracking(char[][] maze, int[] startLoc, int[] destLoc)
  {
    this.maze = maze;
    this.currLoc = startLoc;
    this.destLoc = destLoc;
  }
  
  public boolean hitDest()
  {
    if (maze[currLoc[0]][currLoc[1]]=='Z') 
    {
      return true; 
    } // end of if
    else 
    {
      return false;
    } // end of if-else
  }
  
  public void checkPossDirect()
  {
    int i;
    for (i=0;i<possDirect.length;i++) 
    {
      possDirect[i] = true; 
    } // end of for
    
    if (hitWall(currLoc[0]-1,currLoc[1])) 
    {
      possDirect[0] = false;
    } // end of if
    if (hitWall(currLoc[0],currLoc[1]-1)) 
    {
      possDirect[1] = false;  
    } // end of if
    if (hitWall(currLoc[0]+1,currLoc[1])) 
    {
      possDirect[2] = false;
    } // end of if
    if (hitWall(currLoc[0],currLoc[1]+1)) 
    {
      possDirect[3] = false;
    } // end of if
    
    moveList.add(new Location(currLoc[0],currLoc[1]));
  }
  
  public boolean hitWall(int x, int y)
  {
    if (maze[x][y]=='-' || maze[x][y] == '|' || maze[x][y] == 'X') 
    {
      return true;
    } // end of if
    else 
    {
      return false;
    } // end of if-else
  }
  
  public void move()
  {
    int i;
    System.out.print("currLoc: ");
    for (i=0;i<currLoc.length;i++) 
    {
      System.out.print(currLoc[i]+" "); 
    } // end of for
    System.out.println();
    
    maze[currLoc[0]][currLoc[1]] = 'X';
    
    int countPossDirects=0;
    for (i=0;i<possDirect.length;i++) 
    {
      if (possDirect[i]) 
      {
        countPossDirects++;
      } // end of if
    } // end of for
    
    if (countPossDirects>0) 
    {
      countBackTrack = 0;
      int direct = (int)(Math.random()*4);
      while (!possDirect[direct]) 
      { 
        direct = (int)(Math.random()*4);  
      } // end of while
      switch (direct) 
      {
        case 0 : currLoc[0] = currLoc[0]-1;
        break;
        case 1 : currLoc[1] = currLoc[1]-1;
        break;
        case 2 : currLoc[0] = currLoc[0]+1;
        break;
        case 3 : currLoc[1] = currLoc[1]+1;
        break;
        default :  System.out.println("dafuq?");
        break;
      } // end of switch
    } // end of if
    else 
    {
      countBackTrack++;
      if (countBackTrack<2) 
      {
        moveList.remove(moveList.size()-1);
        currLoc[0] = moveList.get(moveList.size()-1).getX();
        currLoc[1] = moveList.get(moveList.size()-1).getY();
      } // end of if
      else 
      {
        moveList.remove(moveList.size()-1);
        moveList.remove(moveList.size()-1);
        currLoc[0] = moveList.get(moveList.size()-1).getX();
        currLoc[1] = moveList.get(moveList.size()-1).getY();  
      } // end of if-else
    } // end of if-else
  }
  
  public Location getCurrLoc()
  {
    return moveList.get(moveList.size()-1);  
  }
}

Java:
import java.awt.*;
import javax.swing.*;
import java.io.*;

public class Visual extends JFrame
{
  Maze m;
  char[][] maze;
  String[] mazeLines;
  VisualPanel panel = new VisualPanel();
  
  public Visual() throws FileNotFoundException, IOException
  {
    m = new Maze();
    maze = m.getMaze();
    mazeLines = getMazeLines();
    panel.setMaze(maze);
    int i;
    for (i=0;i<mazeLines.length;i++) 
    {
      System.out.println("mazeLines["+i+"] " + mazeLines[i]);
    } // end of for
    Visual frame = new Visual("Irrgartenspiel");
    frame.setVisible(true);
  }
  
  public Visual(String title)
  {
    super(title);
    setBounds(10,10,300,300);
    setLayout(null);
    panel.setBounds(0,0,300,300);
    add(panel);  
  }
  
  public String[] getMazeLines()
  {
    int i,j,k=0;
    String[] mL = new String[maze[0].length];
    for (i=0;i<maze[0].length;i++) 
    {
      mL[i] = "" + maze[0][i];
    } // end of for
    for (i=0;i<maze[0].length;i++) 
    {
      for (j=0;j<maze.length-1;j++) 
      {
        mL[k] = mL[k] + "" + maze[j+1][i];  
      } // end of for
      k++;
    } // end of for
    
    return mL; 
  }
  
  public void draw(Location loc)
  {
    int x = loc.getX();
    int y = loc.getY();
    int i;
    char[] c = mazeLines[y].toCharArray();
    c[x] = 'X';
    String newLine = "" + c[0];
    for (i=1;i<c.length;i++) 
    {
      newLine = newLine + "" + c[i];
    } // end of for
    mazeLines[y] = newLine;
    /*for (i=0;i<mazeLines.length;i++) 
    {
    System.out.println(mazeLines[i]);
    } // end of for*/   
    mazeLines = getMazeLines();
    panel.setCurrLoc(loc);
    panel.setCurrMaze();
    repaint();
  }
}

Java:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*; 
import javax.swing.event.*;
 
 public class VisualPanel extends JPanel
{
  char[][] maze;
  char[][] currMaze;
  String[] currMazeString;
  Location loc;
  int x = 0;
  
  @Override
  public void paintComponent(Graphics g)
  {
    super.paintComponent(g);
    if (x!=0) 
    {
      int i;
      for (i=0;i<currMazeString.length;i++)
      {
        g.drawString(currMazeString[i],10,20*i);  
      } // end of for
    } // end of if
    System.out.println("x");
    System.out.println(x);
    
  }
  
  public void setMaze(char[][] maze)
  {
    this.maze = maze;
    x++;
  }
  
  public void setCurrMaze()
  {
    currMaze = maze;
    int x = loc.getX();
    int y = loc.getY();
    currMaze[x][y] = 'X';
    currMazeString = new String[currMaze[x].length];
    int i,j;
    String s = "" + currMaze[0][0];
    for (i=0;i<currMaze[0].length;i++) 
    {
      for (j=1;j<currMaze.length;j++) 
      {
        currMazeString[i] = s + "" + currMaze[j][i];
        s = currMazeString[i];
      } // end of for
      s = "" + currMaze[0][i];
    } // end of for
    
  }
  
  public void setCurrLoc(Location loc)
  {
    this.loc = loc; 
  }
}

Java:
public class Location
{
  int x;
  int y;
  
  public Location(int x, int y)
  {
    this.x = x;
    this.y = y;
  }
  
  public int getX()
  {
    return this.x;  
  }
  
  public int getY()
  {
    return this.y;  
  }
}
 

whoopsie

Mitglied
Moin,

das ist auch richtig so.

Die Objekte in der paintComponent() sind nicht initialisiert, d. h. paintComponent() wird vor setCurrMaze() aufgerufen. Ein typisches Problem - designtechnischer Art.

Du solltest alles, was in einer Methode, welche "von extern" aufgerufen werden kann, wie z. B. die paint()- oder paintComponent()-Methode, initialisiert bzw. instanziiert haben, bevor besagte Methode aufgerufen werden kann ... bei Dir evtl. im Konstruktor der Klasse. Alles andere ist Murks.

Java:
  String[] currMazeString = new String[] {};

Solltest Du merken, dass das nicht sooo einfach möglich ist, dann überdenke den Ablauf bzw. das Design des Programms.

Gruß
 
Zuletzt bearbeitet:
Ja, paintComponent() wird vor setCurrentMaze() aufgerufen, aber ich lasse sie ja dann nicht auf die noch nicht initialisierten Objekte zugreifen durch die if-Abfrage. Ist sicher kein sauberer Programmierstil, aber theoretisch müsste das ja trotzdem funktionieren.

Mein Problem ist also nur, dass ich nicht verstehe, warum diese if-Abfrage beim zweiten Aufruf (bis dahin wurde x durch setMaze() 100%ig erhöht) dann immer noch false ist und die Objekte, die dann schließlich initalisiert wurden, in paintComponent immer noch eine NullPointerException werfen.
 

whoopsie

Mitglied
Ok, bitte poste die/eine Maze-Klasse, damit der Code ausführbar wird... evtl. fällt ja dem einen oder anderen was bei der Ausführung / beim Debuggen am heimischen Rechner auf.
 

Joose

Top Contributor
Java:
public class Visual extends JFrame
{
  Maze m;
  char[][] maze;
  String[] mazeLines;
  VisualPanel panel = new VisualPanel();
  
  public Visual() throws FileNotFoundException, IOException
  {
    m = new Maze();
    maze = m.getMaze();
    mazeLines = getMazeLines();
    panel.setMaze(maze);
    int i;
    for (i=0;i<mazeLines.length;i++) 
    {
      System.out.println("mazeLines["+i+"] " + mazeLines[i]);
    } // end of for
    Visual frame = new Visual("Irrgartenspiel");
    frame.setVisible(true);
  }
  
  public Visual(String title)
  {
    super(title);
    setBounds(10,10,300,300);
    setLayout(null);
    panel.setBounds(0,0,300,300);
    add(panel);  
  }

Im Konstruktor deiner Visual Klasse erstellst du ein neues Objekt dieser Klasse.
1) Bei diesem Objekt sind aber keine Attribute gesetzt!
2) Warum willst du im Konstruktor eine neues Objekt der gleichen Klasse erstellen?

Sichtbar machst du dann eigentlich nur dieses "uninitialisiertes" Visual Objekt und dadurch bekommt das entsprechende VisualPanel Objekt keine Attribute gesetzt.
 
Zuletzt bearbeitet:

whoopsie

Mitglied
Jo, nicht so schön, wie Joose sagte ...

{ Offline-Debugger an }

Ob das nun beabsichtigt ist, weiss ich nicht. Wenn nicht, dann mal folgendes mit dem Zitiat von Joose versuchen:
- Zeile 20 raus,
- Zeile 21 in "this.setVisible(true);" ändern und
- am Anfang des Konstruktors ein "this("Irrgartenspiel") einfügen und
- den Konstruktor mit dem String-Argument private machen.

{ Offline-Debugger aus }

:noe:
 
Zuletzt bearbeitet:
Sorry, hatte die letzten Tage keine Zeit.

Ich hab jetzt war nicht ganz verstanden, warum das Objekt uninitialisiert sein soll, wenn ich es doch im Konstruktor von Visual initialisiere (muss ich, weil sonst eine FileNotFoundException fliegt, also geht nur im Konstruktor). Außerdem, laut Debugger kommt in allen Methoden von VisualPanel dieses initialisierte Objekt auch richtig an, nur eben in paintComponent() nicht.

Nichtdestotrotz funktioniert es jetzt mit der Anleitung von whoopsie :D

Vielen Dank an euch beide ! :)

Ich stell mal nochmal alle Klassen rein. Das kommentierte bei Visual ist meine vorheriger Ansatz, wenn man super("Irrgartenspiel"), und die restlichen Methoden zwischen Visual frame = new Visual(); und frame.setVisible(true); auskommentiert, und dafür eben Visual frame = new Visual(); und frame.setVisible(true); wieder gültig werden lässt.

Irrgartenspiel.java
Java:
import java.io.*;
public class Irrgartenspiel
{
  public static void main(String[] args) throws FileNotFoundException, IOException
  {
    Player player1 = new Player();
    player1.play();
  }
}

Player.java
Java:
import java.io.*;
public class Player
{
  char[][] maze;
  int[] startLoc;
  int[] destLoc;
  
  public Player() throws FileNotFoundException, IOException
  {
    Maze m = new Maze();
    maze = m.getMaze();
    startLoc = m.getStartLoc();
    destLoc = m.getDestLoc();
  }
  public void play() throws FileNotFoundException, IOException
  {
    Tracking t = new Tracking(maze,startLoc,destLoc);
    Visual v = new Visual();
    int count = 0;    
    while (!t.hitDest()) 
    { 
      t.checkPossDirect();
      v.draw(t.getCurrLoc());
      t.move();
      count++;      
    } // end of while
    System.out.println("Schritte: " + count);
  }
}

Maze.java
Java:
import java.io.*;
public class Maze
{
  char[][] maze;
  
  //Einlesen des Labyrinths aus Textdatei
  public Maze() throws FileNotFoundException, IOException
  {
    String[] line;
    int countLine = 0;
    int i,j,k;
    FileReader fr = new FileReader("maze.txt");
    BufferedReader br = new BufferedReader(fr);
    
    br.mark(100000);
    while (br.readLine()!=null) 
    { 
      countLine++; 
    } // end of while
    br.reset();
    
    line = new String[countLine];
    for (i=0;i<countLine;i++) 
    {
      line[i] = br.readLine();
    } // end of for
    br.close();
    
    k = 0;
    maze = new char[line[0].length()][countLine];
    for (i=0;i<countLine;i++) 
    {
      for (j=0;j<line[0].length();j++) 
      {
        maze[j][i] = line[k].charAt(j);
        //System.out.print(maze[j][i]); 
      } // end of for
      //System.out.println();
      k++;
    } // end of for
  }
  
  public char[][] getMaze()
  {
    return maze;
  }
  public int[] getStartLoc()
  {
    int i,j;
    int[] startLoc = new int[2];
    for (i=0;i<maze.length;i++) 
    {
      for (j=0;j<maze[0].length;j++) 
      {
        if (maze[i][j]=='S') 
        {
          startLoc[0] = j; //x-Koordinate (rechts,links)
          startLoc[1] = i; //y-Koordinate (oben,unten)
        } // end of if
      } // end of for
    } // end of for
    return startLoc;
  }
  public int[] getDestLoc()
  {
    int i,j;
    int[] destLoc = new int[2];
    for (i=0;i<maze.length;i++) 
    {
      for (j=0;j<maze[0].length;j++) 
      {
        if (maze[i][j]=='Z') 
        {
          destLoc[0] = j; //x-Koordinate (rechts,links)
          destLoc[1] = i; //y-Koordinate (oben,unten)
        } // end of if
      } // end of for
    } // end of for
    return destLoc; 
  }
}

Tracking.java
Java:
import java.util.ArrayList;

public class Tracking
{
  char[][] maze;
  int[] currLoc;
  int[] destLoc;
  boolean[] possDirect = new boolean[4]; //0 = links, 1 = oben, 2 = rechts, 3 = unten
  ArrayList<Location> moveList = new ArrayList<Location>();
  int countBackTrack = 0;
  
  public Tracking(char[][] maze, int[] startLoc, int[] destLoc)
  {
    this.maze = maze;
    this.currLoc = startLoc;
    this.destLoc = destLoc;
  }
  
  public boolean hitDest()
  {
    if (maze[currLoc[0]][currLoc[1]]=='Z') 
    {
      return true; 
    } // end of if
    else 
    {
      return false;
    } // end of if-else
  }
  
  public void checkPossDirect()
  {
    int i;
    for (i=0;i<possDirect.length;i++) 
    {
      possDirect[i] = true; 
    } // end of for
    
    if (hitWall(currLoc[0]-1,currLoc[1])) 
    {
      possDirect[0] = false;
    } // end of if
    if (hitWall(currLoc[0],currLoc[1]-1)) 
    {
      possDirect[1] = false;  
    } // end of if
    if (hitWall(currLoc[0]+1,currLoc[1])) 
    {
      possDirect[2] = false;
    } // end of if
    if (hitWall(currLoc[0],currLoc[1]+1)) 
    {
      possDirect[3] = false;
    } // end of if
    
    moveList.add(new Location(currLoc[0],currLoc[1]));
  }
  
  public boolean hitWall(int x, int y)
  {
    if (maze[x][y]=='-' || maze[x][y] == '|' || maze[x][y] == 'X') 
    {
      return true;
    } // end of if
    else 
    {
      return false;
    } // end of if-else
  }
  
  public void move()
  {
    int i;
    System.out.print("currLoc: ");
    for (i=0;i<currLoc.length;i++) 
    {
      System.out.print(currLoc[i]+" "); 
    } // end of for
    System.out.println();
    
    maze[currLoc[0]][currLoc[1]] = 'X';
    
    int countPossDirects=0;
    for (i=0;i<possDirect.length;i++) 
    {
      if (possDirect[i]) 
      {
        countPossDirects++;
      } // end of if
    } // end of for
    
    if (countPossDirects>0) 
    {
      countBackTrack = 0;
      int direct = (int)(Math.random()*4);
      while (!possDirect[direct]) 
      { 
        direct = (int)(Math.random()*4);  
      } // end of while
      switch (direct) 
      {
        case 0 : currLoc[0] = currLoc[0]-1;
        break;
        case 1 : currLoc[1] = currLoc[1]-1;
        break;
        case 2 : currLoc[0] = currLoc[0]+1;
        break;
        case 3 : currLoc[1] = currLoc[1]+1;
        break;
        default :  System.out.println("dafuq?");
        break;
      } // end of switch
    } // end of if
    else 
    {
      countBackTrack++;
      if (countBackTrack<2) 
      {
        moveList.remove(moveList.size()-1);
        currLoc[0] = moveList.get(moveList.size()-1).getX();
        currLoc[1] = moveList.get(moveList.size()-1).getY();
      } // end of if
      else 
      {
        moveList.remove(moveList.size()-1);
        moveList.remove(moveList.size()-1);
        currLoc[0] = moveList.get(moveList.size()-1).getX();
        currLoc[1] = moveList.get(moveList.size()-1).getY();  
      } // end of if-else
    } // end of if-else
  }
  
  public Location getCurrLoc()
  {
    return moveList.get(moveList.size()-1);  
  }
}

Visual.java
Java:
import java.awt.*;
import javax.swing.*;
import java.io.*;

public class Visual extends JFrame
{
  Maze m;
  char[][] maze;
  String[] mazeLines;
  VisualPanel panel = new VisualPanel();
  
  public Visual() throws FileNotFoundException, IOException
  {
    super("Irrgartenspiel");
    m = new Maze();
    maze = m.getMaze();
    mazeLines = getMazeLines();
    panel.setMaze(maze);
    int i;
    for (i=0;i<mazeLines.length;i++) 
    {
      System.out.println("mazeLines["+i+"] " + mazeLines[i]);
    } // end of for
    //Visual frame = new Visual("Irrgartenspiel");
    setBounds(10,10,300,300);
    setLayout(null);
    panel.setBounds(0,0,300,300);
    add(panel);
    this.setVisible(true);
    //frame.setVisible(true);
  }
  
  /*public Visual(String title)
  {
    super(title);
    setBounds(10,10,300,300);
    setLayout(null);
    panel.setBounds(0,0,300,300);
    add(panel);  
  }*/
  
  public String[] getMazeLines()
  {
    int i,j,k=0;
    String[] mL = new String[maze[0].length];
    for (i=0;i<maze[0].length;i++) 
    {
      mL[i] = "" + maze[0][i];
    } // end of for
    for (i=0;i<maze[0].length;i++) 
    {
      for (j=0;j<maze.length-1;j++) 
      {
        mL[k] = mL[k] + "" + maze[j+1][i];  
      } // end of for
      k++;
    } // end of for
    
    return mL; 
  }
  
  public void draw(Location loc)
  {
    int x = loc.getX();
    int y = loc.getY();
    int i;
    char[] c = mazeLines[y].toCharArray();
    c[x] = 'X';
    String newLine = "" + c[0];
    for (i=1;i<c.length;i++) 
    {
      newLine = newLine + "" + c[i];
    } // end of for
    mazeLines[y] = newLine;
    /*for (i=0;i<mazeLines.length;i++) 
    {
    System.out.println(mazeLines[i]);
    } // end of for*/   
    mazeLines = getMazeLines();
    panel.setCurrLoc(loc);
    panel.setCurrMaze();
    repaint();
  }
}

VisualPanel.java
Java:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*; 
import javax.swing.event.*;
 
 public class VisualPanel extends JPanel
{
  char[][] maze;
  char[][] currMaze;
  public String[] currMazeString;
  Location loc;
  int x = 0;
  
  @Override
  public void paintComponent(Graphics g)
  {
    super.paintComponent(g);
    if (x!=0) 
    {
      int i;
      for (i=0;i<currMazeString.length;i++)
      {
        g.drawString(currMazeString[i],10,20*i);  
      } // end of for
    } // end of if
    System.out.println("x");
    System.out.println(x);
    
  }
  
  public void setMaze(char[][] maze)
  {
    this.maze = maze;
    x++;
  }
  
  public void setCurrMaze()
  {
    currMaze = maze;
    int x = loc.getX();
    int y = loc.getY();
    currMaze[x][y] = 'X';
    currMazeString = new String[currMaze[x].length];
    int i,j;
    String s = "" + currMaze[0][0];
    for (i=0;i<currMaze[0].length;i++) 
    {
      for (j=1;j<currMaze.length;j++) 
      {
        currMazeString[i] = s + "" + currMaze[j][i];
        s = currMazeString[i];
      } // end of for
      s = "" + currMaze[0][i];
    } // end of for
    
  }
  
  public void setCurrLoc(Location loc)
  {
    this.loc = loc; 
  }
}

Location.java
Java:
public class Location
{
  int x;
  int y;
  
  public Location(int x, int y)
  {
    this.x = x;
    this.y = y;
  }
  
  public int getX()
  {
    return this.x;  
  }
  
  public int getY()
  {
    return this.y;  
  }
}


Java:



Jetzt stehe ich vor einer neuen Frage:

Im Konstruktor von Visual übergebe ich dem VisualPanel-Objekt das Maze-Objekt, in dem nur das Layrinth und das Ziel sichtbar ist, eben wie in der Textdatei. Dies geschieht einmalig. Das VisualPanel-Objekt weiß also jetzt, wie das Labyrinth am Anfang aussah.

Jetzt übergebe ich in Visual.draw() immer wieder eine neue Location (currLoc) dem VisualPanel-Objekt, die ich vom Tracking-Objekt erhalte. Das aktuelle Labyrinth (currMaze) besteht also aus der anfänglichen Labyrinth und der immer wieder neuen Location. Also muss ich immer nur in das anfängliche Labyrinth die neue Location reinschreiben.

Das mache ich doch auch in VisualPanel.setCurrMaze() oder nicht ?

Aber irgendwie verändert sich mein anfängliches Labyrinth auch durch die Zuweisung "currMaze = maze";

Das ist nicht normal, oder ? :D
 

Anhänge

  • maze.txt
    129 Bytes · Aufrufe: 2
Zuletzt bearbeitet:
Ähnliche Java Themen
  Titel Forum Antworten Datum
L NullpointerException wegen wahrscheinlichem Multithreading Java Basics - Anfänger-Themen 4
M NullPointerException: Cannot read the array length because "this.Kinder" is null Java Basics - Anfänger-Themen 1
H Liste Knoten NullPointerException Java Basics - Anfänger-Themen 7
C Compiler-Fehler NullPointerException Java Basics - Anfänger-Themen 10
LePetitChat1 Arrays - NullPointerException? Java Basics - Anfänger-Themen 14
berserkerdq2 Nullpointerexception, obwohl ich Array initialisiere? Java Basics - Anfänger-Themen 1
U Warum gibt das eine Nullpointerexception? (Switch) Java Basics - Anfänger-Themen 6
missy72 Klassen Objekt Array NullPointerException Java Basics - Anfänger-Themen 3
Jose05 Nullpointerexception Java Basics - Anfänger-Themen 7
emx-zee Erste Schritte NullPointerException, Array mit zufälligen Zahlen füllen Java Basics - Anfänger-Themen 2
Jose05 Nullpointerexception bei Umwandlung von String zu int Java Basics - Anfänger-Themen 2
H Java NullPointerException Java Basics - Anfänger-Themen 4
YaU Vererbung erstellt NullPointerException? Java Basics - Anfänger-Themen 4
D Hilfe beim Erzeugen eines Arrays NullPointerException wird ausgelöst Java Basics - Anfänger-Themen 11
L Threads Komischer NullPointerException Java Basics - Anfänger-Themen 2
H Fehler: NullPointerException und ich weiß net warum Java Basics - Anfänger-Themen 4
F Fehlermeldung java.lang.NullPointerException Java Basics - Anfänger-Themen 4
Avalon NullPointerException beim Mocken Java Basics - Anfänger-Themen 6
D NullPointerException in foreach loop Java Basics - Anfänger-Themen 1
D java.lang.NullPointerException Java Basics - Anfänger-Themen 19
T Bufferedwriter code Nullpointerexception Java Basics - Anfänger-Themen 4
D NullPointerException im Array Java Basics - Anfänger-Themen 4
X java.lang.NullPointerException fehler ? Java Basics - Anfänger-Themen 1
B java.lang.NullPointerException bei javafx Java Basics - Anfänger-Themen 10
J NullPointerException beim Klonnen eines Arayys und beim aufrufen einer Methode Java Basics - Anfänger-Themen 2
V NullPointerException Java Basics - Anfänger-Themen 2
S NullPointerException während ResultSet Java Basics - Anfänger-Themen 7
V NullPointerException, wenn Key und Value null sind Java Basics - Anfänger-Themen 2
scratchy1 NullPointerException Java Basics - Anfänger-Themen 19
U Was löst meine NullPointerException aus? (Vererbung) Java Basics - Anfänger-Themen 12
F Wie kann ich diese NullPointerException umgehen?! Java Basics - Anfänger-Themen 41
dapzoo Compiler-Fehler Beim Werte verteilen in Objektarray NullPointerException Java Basics - Anfänger-Themen 4
W Optional<T> - NullPointerException Java Basics - Anfänger-Themen 37
Jascha NullPointerException vs NumberFormatException Java Basics - Anfänger-Themen 5
L Variablen NullPointerException bei Dateigröße (Nr.1) Java Basics - Anfänger-Themen 4
M Compiler-Fehler NullPointerException Java Basics - Anfänger-Themen 13
D NullPointerException umgehen Java Basics - Anfänger-Themen 17
Z Objekt Array führt zum NullPointerException Java Basics - Anfänger-Themen 2
W NullPointerException obwohl nicht null? Java Basics - Anfänger-Themen 3
W ArrayList NullPointerException Java Basics - Anfänger-Themen 4
A NullPointerException Java Basics - Anfänger-Themen 6
S NullPointerException Java Basics - Anfänger-Themen 4
T OOP Wörterbuch NullPointerException Java Basics - Anfänger-Themen 4
R Exception in thread "main" java.lang.NullPointerException Java Basics - Anfänger-Themen 10
O NullPointerException Java Basics - Anfänger-Themen 2
M Interpreter-Fehler Feld NullPointerException Java Basics - Anfänger-Themen 4
L Variablen Unerklärliche NullPointerException Java Basics - Anfänger-Themen 2
E Compiler-Fehler nullPointerException in verschachteltem Modell Java Basics - Anfänger-Themen 6
DaCrazyJavaExpert Threads NullPointerException Java Basics - Anfänger-Themen 8
DaCrazyJavaExpert Compiler-Fehler Variable nicht mit null initialisiert, trotzdem: NullPointerException Java Basics - Anfänger-Themen 28
kodela NullPointerException Java Basics - Anfänger-Themen 12
R Taschenrechner NullPointerException Java Basics - Anfänger-Themen 1
H java.lang.NullPointerException Java Basics - Anfänger-Themen 4
H NullPointerException obwohl Objekt angelegt wurde Java Basics - Anfänger-Themen 1
A Threads Reentrantlock | NullpointerException möglicher Deadlock? Java Basics - Anfänger-Themen 0
K Compiler-Fehler NullPointerException lösen Java Basics - Anfänger-Themen 16
G java.lang.NullPointerException Java Basics - Anfänger-Themen 3
P Compiler-Fehler NullPointerException Java Basics - Anfänger-Themen 1
E Compiler-Fehler java.lang.NullPointerException Java Basics - Anfänger-Themen 2
S Methoden Methode funktioniert nicht | NullPointerException Java Basics - Anfänger-Themen 6
F NullpointerException bei zweidimensionalem Array Java Basics - Anfänger-Themen 2
Z OOP - Array ständig NullPointerException Java Basics - Anfänger-Themen 4
J Verstehe die NullPointerException nicht Java Basics - Anfänger-Themen 1
T Nullpointerexception und es wird nichts angezeigt Java Basics - Anfänger-Themen 15
H NullPointerException, aber wieso? Java Basics - Anfänger-Themen 5
B ProcessMessage NullPointerException Java Basics - Anfänger-Themen 11
shiroX Compiler-Fehler NullPointerException Java Basics - Anfänger-Themen 9
MrSnake ItemListener mit NullPointerException Java Basics - Anfänger-Themen 3
J java.lang.NullPointerException in meiner JavaFXControllerKlasse Java Basics - Anfänger-Themen 26
M NullPointerException Java Basics - Anfänger-Themen 8
B Vererbung NullPointerException Java Basics - Anfänger-Themen 38
D Communications link failure | java.lang.NullPointerException Java Basics - Anfänger-Themen 3
G NullPointerException Java Basics - Anfänger-Themen 1
J NullpointerException Java Basics - Anfänger-Themen 1
M Interpreter-Fehler Nullpointerexception trotz Ordentlicher Initialisierung Java Basics - Anfänger-Themen 4
F java.lang.NullPointerException, kann aber nicht sein! Java Basics - Anfänger-Themen 4
M String-Vergleich und NullPointerException Java Basics - Anfänger-Themen 4
D Java Fehler: NullPointerException Java Basics - Anfänger-Themen 1
M Vergleich zweier Array Stellen mit equals/NullpointerException Java Basics - Anfänger-Themen 9
X Problem mit NullPointerException Java Basics - Anfänger-Themen 2
K NullPointerException in der Hashtable Java Basics - Anfänger-Themen 4
S Interpreter-Fehler Hilfestellung bei einer NullPointerException Java Basics - Anfänger-Themen 1
S GraphNode --- Dijkstra Algorithmus : NullPointerException Java Basics - Anfänger-Themen 1
L NullPointerException Java Basics - Anfänger-Themen 11
M Nullpointerexception??? Java Basics - Anfänger-Themen 2
W NullPointerException bei DefaultListModel Java Basics - Anfänger-Themen 5
N NullPointerException bei Konsolenausgabe Java Basics - Anfänger-Themen 5
J Klasse in Klasse; NullPointerException Java Basics - Anfänger-Themen 8
Q NullPointerException Java Basics - Anfänger-Themen 5
H NullPointerException Java Basics - Anfänger-Themen 5
T Threads MultiThreading NullPointerException Java Basics - Anfänger-Themen 7
K NullPointerException wird geworfen, bitte um Hilfe! Java Basics - Anfänger-Themen 7
O Objekt weitergeben Meth Class NullPointerException Java Basics - Anfänger-Themen 2
J Char-Array - NullPointerException Java Basics - Anfänger-Themen 3
M Compiler-Fehler Java suckt - java.lang.NullPointerException Java Basics - Anfänger-Themen 12
S Array wird nicht übernommen NullPointerException Java Basics - Anfänger-Themen 6
S Datentypen List.toString wirft NullPointerException Java Basics - Anfänger-Themen 5
L Compiler-Fehler Exception in thread "main" java.lang.NullPointerException Java Basics - Anfänger-Themen 2
H Compiler-Fehler NullPointerException bei .length, Konstruktor fehlerhaft? Java Basics - Anfänger-Themen 3
B JRadioButton wechsel gibt NullPointerException Java Basics - Anfänger-Themen 2

Ähnliche Java Themen

Neue Themen


Oben