this.spal.setPalette(sp.getPalette());
if (num == 4) { usingMapPal = true; tilesetBox.setEnabled(true); TileEditor.Tileset ts = TileEditor.tilesets[tileset .getSelectedIndex()]; int pn = tilesetPal.getSelectedIndex(); int subpal = (ts.getPaletteColor(0, pn, 2).getRed() >> 3) - 2; Color[] tmp = ts.getPaletteColors(pn, subpal); tmp[0] = Sprite.pals[0][0]; this.spal.setPalette(tmp); } else { usingMapPal = false; tilesetBox.setEnabled(false); this.spal.setPalette(sp.getPalette()); }
    private void changePalette(int num)    {        if (num < 0 || num > 7)            return;        SpriteInfo spi = getSpriteInfo(HackModule.getNumberOfString(selector            .getSelectedItem().toString(), false));        sib[spi.sptNum].palette = num;        Sprite sp = new Sprite(spi, this);        sp.setImage(this.spriteDrawingArea.getIntArrImage());        this.spal.setPalette(sp.getPalette());        spal.repaint();        this.spriteDrawingArea.setImage(sp.getSprite());    }