При запуске выходят ошибки
java.lang.NullPointerException: Cannot invoke "com.sun.javafx.font.directwrite.IWICImagingFactory.CreateBitmap(int, int, int, int)" because "<local3>" is null
at javafx.graphics/com.sun.javafx.font.directwrite.DWGlyph.createBitmap(DWGlyph.java:287)
at javafx.graphics/com.sun.javafx.font.directwrite.DWGlyph.getCachedBitmap(DWGlyph.java:273)
at javafx.graphics/com.sun.javafx.font.directwrite.DWGlyph.getD2DMask(DWGlyph.java:167)
at javafx.graphics/com.sun.javafx.font.directwrite.DWGlyph.getPixelData(DWGlyph.java:352)
at javafx.graphics/com.sun.prism.impl.GlyphCache.getCachedGlyph(GlyphCache.java:258)
at javafx.graphics/com.sun.prism.impl.GlyphCache.render(GlyphCache.java:148)
at javafx.graphics/com.sun.prism.impl.ps.BaseShaderGraphics.drawString(BaseShaderGraphics.java:2101)
at javafx.graphics/com.sun.javafx.sg.prism.NGText.renderText(NGText.java:312)
at javafx.graphics/com.sun.javafx.sg.prism.NGText.renderContent2D(NGText.java:270)
at javafx.graphics/com.sun.javafx.sg.prism.NGShape.renderContent(NGShape.java:261)
at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:578)
at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:578)
at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:479)
at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:328)
at javafx.graphics/com.sun.javafx.tk.quantum.UploadingPainter.run(UploadingPainter.java:142)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at javafx.graphics/com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.base/java.lang.Thread.run(Thread.java:832)
package com.javarush.games.minigames.mini02;
import com.javarush.engine.cell.Color;
import com.javarush.engine.cell.Game;
/*
Отображаем корабль
*/
public class FigureView extends Game {
public static final int[][] SHIP = new int[][]{
{0, 0, 7, 0, 0},
{0, 7, 7, 7, 0},
{0, 7, 0, 7, 0},
{0, 7, 7, 7, 0},
{0, 7, 0, 7, 0},
{7, 7, 7, 7, 7},
{7, 0, 7, 0, 7},
};
@Override
public void initialize() {
setScreenSize(5, 7);
showShip();
}
public void showShip() {
for (int i = 0; i < SHIP.length; i++) {
for (int j = 0; j < SHIP[0].length; j++) {
setCellColor(j, i, Color.values()[SHIP[i][j]]);
}
}
}
}