Buggy code:
public class Game extends JPanel { public static int MAX_CELLS = 100 ; public static int CELL_LENGTH = 40 ; public static float FPS = 15 ; private int numRows ; private int numCols ; private int numWalls ; private String mapFileName ; private String playerFileName ; private String enemyFileName ; private String projectileFileName ; private String weaponFileName ; private String wallFileName ; private String [ ] [ ] layout = new String [ Game . MAX_CELLS ] [ Game . MAX_CELLS ] ; private Player cat ; private EnemyManager enemyManager ; private Weapon slingshot ; private ArrayList < String > inputs ; private boolean shouldClearInputs ; LinkedList < KeyEvent > keyQueue ; LinkedList < MouseEvent > mouseQueue ; private long previousTime ; private Game . WeaponListener weaponListener ; private boolean shotFired ; private CollisionManager collisionManager ; private WallManager wallManager ; public Game ( String mapFile , String playerFile , String enemyFile , String projectileFile , String weaponFile , String wallFile ) { } public void Update ( long currentTime ) { } public void loadConfigFiles ( ) { } private void LoadComponents ( ) { } public void loadWeapon ( ) { } public void loadCat ( ) { } public void loadEnemyManager ( ) { } public void loadWallManager ( ) { } public void fillLayout ( String fileName ) throws BadConfigFormatException { } public int calculateAngle ( int initPos , int newPos ) { } public void addEvent ( KeyEvent e ) { } public int getNumRows ( ) { } public int getNumColumns ( ) { } public boolean isWallAt ( int row , int col ) { } public int getNumWalls ( ) { } public void shotFired ( boolean val ) { } public ArrayList < String > getInputs ( ) { } public boolean shouldClearInputs ( ) { } public void clearInputs ( boolean val ) { } public void processInputs ( ) { } public void paintComponent ( Graphics g ) { super . paintComponent ( g ) ; cat . Draw ( g ) ; slingshot . Draw ( g ) ; enemyManager . Draw ( g ) ; wallManager . Draw ( g ) ; <START_BUG> g . drawString ( Integer . toString ( slingshot . getAngle ( ) ) , ( ( int ) ( ( ( int ) ( slingshot . position . x ) ) + ( slingshot . getLocationX ( ) ) ) ) , ( ( int ) ( slingshot . position . y ) ) ) ; <END_BUG> g . drawLine ( ( ( int ) ( ( ( int ) ( slingshot . position . x ) ) + ( slingshot . getLocationX ( ) ) ) ) , ( ( int ) ( ( ( int ) ( slingshot . position . y ) ) + ( slingshot . getLocationY ( ) ) ) ) , ( ( ( int ) ( slingshot . position . x ) ) + 2000 ) , ( ( int ) ( slingshot . position . y ) ) ) ; int positionX = ( ( int ) ( slingshot . position . x ) ) + 2000 ; int positionY = ( ( int ) ( ( ( int ) ( slingshot . position . y ) ) + ( positionX * ( Math . tan ( Math . toRadians ( slingshot . getAngle ( ) ) ) ) ) ) ) ; g . drawLine ( ( ( int ) ( ( ( int ) ( slingshot . position . x ) ) + ( slingshot . getLocationX ( ) ) ) ) , ( ( int ) ( ( slingshot . position . y ) + ( slingshot . getLocationY ( ) ) ) ) , positionX , positionY ) ; } private class InputListener implements KeyListener { private Game game ; InputListener ( Game game ) { } @ Override public void keyTyped ( KeyEvent e ) { } @ Override public void keyPressed ( KeyEvent e ) { } @ Override public void keyReleased ( KeyEvent e ) { } } private class WeaponListener implements MouseInputListener { private Game game ; private int initYPos ; private int newYPos ; private int newXPos ; WeaponListener ( Game game ) { } @ Override public void mouseClicked ( MouseEvent e ) { } @ Override public void mousePressed ( MouseEvent e ) { } @ Override public void mouseReleased ( MouseEvent e ) { } @ Override public void mouseEntered ( MouseEvent e ) { } @ Override public void mouseExited ( MouseEvent e ) { } @ Override public void mouseMoved ( MouseEvent e ) { } @ Override public void mouseDragged ( MouseEvent e ) { } public int getinitPos ( ) { } public int getCurrentPos ( ) { } public void resetValues ( ) { } } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
g . drawString ( Integer . toString ( slingshot . getAngle ( ) ) , ( ( int ) ( ( ( int ) ( slingshot . position . x ) ) + ( ( slingshot . getLocationX ( ) ) * 3 ) ) ) , ( ( int ) ( ( ( int ) ( slingshot . position . y ) ) + ( slingshot . getLocationY ( ) ) ) ) ) ;