小编fil*_*szq的帖子

java.awt.image.DataBufferByte无法强制转换为java.awt.image.DataBufferInt

我在使用JAVA进行编码时遇到了一些错误,我一直在尝试修复此问题,同时也试图找到有相同问题的oterh ppl并修复它但没有任何工作......

嗯..这是代码

    package ca.vanzeben.game;

import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferStrategy;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;

import javax.swing.JFrame;

public class Game extends Canvas implements Runnable {

    private static final long serialVerisionUID = 1L;

    public static final int WIDTH = 160;
    public static final int HEIGHT = WIDTH / 12*9;
    public static final int SCALE = 3;
    public static final String NAME = "Game";

    public boolean running = false;
    public int tickCount = 0;

    private JFrame …
Run Code Online (Sandbox Code Playgroud)

java swing image awt java-canvas

3
推荐指数
2
解决办法
1万
查看次数

标签 统计

awt ×1

image ×1

java ×1

java-canvas ×1

swing ×1