Hello guys. I know that this is not about games, but I’m stuck as hell. Tried on stackoverflow, noone knows how to help.
I can’t make the JProgressDialog visible. I have tried even with Jlabels - there are invisible too. The only thing that I can draw is a Button. I will post my init() method, please, have a look:
public class StartingClass extends Applet implements Runnable, KeyListener {
// dafuq
private static final long serialVersionUID = 1L;
private Player player;
private Image image, background;
private Graphics second;
static Container pane;
private BackgroundAnimation bAnimation1 = new BackgroundAnimation();
private BackgroundAnimation bAnimation2 = new BackgroundAnimation();
private ArrayList<Missile> missiles = new ArrayList<>();
private ArrayList<Blast> blasts = new ArrayList<>();
public static int NUM_OF_MISSILES = 3; // missiles in each wave (increments by level)
public Random randomY = new Random();
public Thread gameloop;
public boolean game_running = false;
private JProgressBar healthBar;
private Button button;
private boolean check = false;
private JLabel message;
@Override
public void init() {
setSize(Constants._Screen_Width, Constants._Screen_Height);
//setBackground(Color.BLACK);
setFocusable(true);
setName("witam");
try {
background = ImageIO.read( ClassLoader.getSystemResource("data/background.png"));
} catch (IOException e) { e.printStackTrace(); }
bAnimation1.setFrames(background);
bAnimation1.setXY(0, 0); // first animation is in the left corner
bAnimation1.setDelay(5);
bAnimation2.setFrames(background);
bAnimation2.setXY(1024, 0);
bAnimation2.setDelay(5);
player = new Player(300, 300);
gameloop = new Thread(this);
healthBar = new JProgressBar(0, 100);
healthBar.setValue(0);
healthBar.setStringPainted(true);
message = new JLabel("Beginning work!");
add(healthBar);
add(message);
addKeyListener(this);
}
Here is a whole class: http://pastebin.com/9j2nC034
I didn’t post whole here cause it’s probably not needed.
If there is someone experienced, I would be thankful. Im sitting here for 3 hours and did NOTHING.