This is PART of my GoldMiner class where the problem is occuring. I am getting a null pointer. I assume it is because of the way I declared my sceneController class. private static Game game; private static sceneController controller; public static void main(String[] args) { Application.launch(GoldMiner.class, (java.lang.String[])null); game = new Game(); running = true; tick(); //Line 26 } //Line 44: update(); private static void update() { controller.totalGoldLabel.setText(Float.toString(game.getTotalGold())); //Line 52 controller.currentGoldLabel.setText(Float.toString(game.getCurGold())); } Error Exception in thread "main" java.lang.NullPointerException at com.github.geodox.goldminer.GoldMiner.update(GoldMiner.java:52) at com.github.geodox.goldminer.GoldMiner.tick(GoldMiner.java:44) at com.github.geodox.goldminer.GoldMiner.main(GoldMiner.java:26) Exception in thread "JavaFX Application Thread" sceneController is just the FX Controller, and it is using the …

Member Avatar
Member Avatar
+0 forum 15

Hi, I have created a fragment that contains code for a camera preview. I am now trying to create an activity that will look after taking the picture etc.. Here is my cam preview related code from my fragment (this works just fine) preview = (SurfaceView) view.findViewById(R.id.preview); previewHolder = preview.getHolder(); previewHolder.addCallback(surfaceCallback); previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); @Override public void onStop() { //Unregistering the Listener manager.unregisterListener(this); super.onStop(); } @Override public void onPause() { super.onPause(); if(camera!=null) { camera.stopPreview(); } //On Entering the Pause Method, if in Preview - Stop if (inPreview) { camera.stopPreview(); } //Release the Camera and Set the Camera and InPreview to Negative camera.release(); …

Member Avatar
Member Avatar
+0 forum 2

The End.