java - Refactoring Code Between Projects Results in RuntimeException: Uncompilable Code -
when copied on gui classes project new one, thought easy. unfortunately, wasn't. made game named entwine, who's package name net.jibini.entwine
, new project's package name net.jibini.pilgrim
. when attempt run refactored code (taken entwine , put pilgrim), error: java.lang.runtimeexception: uncompilable source code - package net.jibini.entwine not exist
. can not find link original classes, don't know coming from.
this base gui class:
package net.jibini.pilgrim.gui; /** * * @author zgoethel12 */ public abstract class gui { public abstract void render(); }
this guipause class:
package net.jibini.pilgrim.gui; import net.jibini.pilgrim.main; import org.lwjgl.opengl.display; /** * * @author zgoethel12 */ import static org.lwjgl.opengl.gl11.*; public class guipause extends gui { guielementbutton back, quit; public guipause() { controls(); } @override public void render() { glpushmatrix(); gltranslatef(0, 0, 10); glbegin(gl_quads); glvertex2f(10, display.getheight() - 10); glvertex2f(440, display.getheight() - 10); glvertex2f(440, 10); glvertex2f(10, 10); glend(); if (display.wasresized()) { controls(); } gltranslatef(0, 0, 1); back.render(); quit.render(); glpopmatrix(); } public void controls() { = new guielementbutton(20, 20, 400, "back"); quit = new guielementbutton(20, display.getheight() - (back.height + 20), 400, "quit"); back.onclick = new onclicklistener() { @override public void onclick() { main.instance.gui = null; } }; quit.onclick = new onclicklistener() { @override public void onclick() { main.instance.exitgame(); main.instance.gui = new guimainmenu(); } }; } }
and lastly, how set gui in game:
if (pressedi.contains(keyboard.key_escape)) { if (gui == null) { try { gui = new guimainmenu(); } catch (exceptionininitializererror err) { system.out.println(err.getcause()); } } else { gui = null; } }
since happens every gui try show, think may problem base gui class or call controls();
in constructor. know problem , how fix , appreciate help!
regards, john smith
the solution problem go "project properties > compiling" , disable "compile on save"
Comments
Post a Comment