This isn't the correct forum. And three posts in two minutes is too many. Moving to Java forum.
What is the error you are having? You mentioned you are new at this but you have a GUI and threading in this. Are you familiar with the basics of java?
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
i am fimiliar with the basics yes and im using eclipse. the problem is is that im at least trying to make somthing in the window i have made but the problem is is nothing appiers at all...
in case you need the other code
Code:
package com.mime.game.graphics;
public class Render {
public final int width;
public final int height;
public final int[] pixels;
public Render(int width, int height) {
this.width = width;
this.height = height;
pixels = new int[width * height];
}
public void draw(Render render, int xOffset, int yOffset) {
for (int y = 0; y < render.height; y++) {
int yPix = y + yOffset;
for (int x = 0; x < render.width; x++) {
int xPix = x + xOffset;
pixels[xPix + yPix * width] = render.pixels[x + y
* render.width];
}
}
}
}
package com.mime.game.graphics;
import java.util.Random;
public class Screen extends Render {
private Render test;
public Screen(int width, int height) {
super(width, height);
Random random = new Random();
test = new Render(256, 256);
for (int i = 0; i < 256 * 256; i++) {
test.pixels[i] = random.nextInt();
}
}
public void render() {
draw(test, 0, 0);
}
}
Okay, so lets look at what you are doing here.
In the main, you issue a game.start() which creates a new thread of this and issues a start command on the thread. The main thread is now returned to the main as the game thread issues a run.
In this run, it's job is to loop while !running, but perform no actions. Since the game is running, this immediately stops this thread's run. This thread is now terminated. Complete control is now just the main thread, which is sitting idle on the main. The application is complete awaiting input for the gui.
So if you are looking to make this do something, you'll need to write what it needs to do in the run method. You'll also likely need to write the entire paint method for the canvas.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php