jar 파일에 문제가 있습니다. NetBeans에서 프로젝트를 실행할 때 모든 것이 잘 동작합니다. 나는 단지 변수에 의해 난을 응용 프로그램을 실행할 때NetBeans에서 jar 파일이 작동하지 않습니다.
public void setBg(int w, int h){
BufferedImage bgg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics g = bgg.getGraphics();
for(int i = 0; i < board.getHeight(); ++i){
for(int j = 0; j < board.getWidth(); ++j){
g.drawImage(board.getBoardElement(j, i).getImage().getScaledInstance(element_w, element_h, Image.SCALE_SMOOTH), ((j*element_w)), ((i*element_h)), this);
System.out.println(j+" "+i);
}
}
bg=bgg; //it's important to not blinkink map while it's drawing
}
매번 및 NullPointerException이 발생할 때 j는 다른 값을 가지고 :하지만 jar 파일을 실행할 때이 기능에 널 포인터 예외를 가지고있다. 그 이유는 무엇일까요?
try-catch에서 메소드를 캡슐화하고 예외에 대한 스택 추적을 인쇄 해 보았습니까? – Dawnkeeper
src 폴더에 사진을 추가 한 다음 깨끗하게 정리하고 다시 시도하십시오. – StasKolodyuk