Quote (irimi @ Jun 12 2012 05:53pm)
you can't. that's not how it works.
the way UI code typically works is that you keep track of the difficulty (or rows/columns/bombs) in some form of a shared state (a class variable in the main handler or something), and on the mouse click event handler, you set those variables and call a reload() method on the entire UI (the reload method obviously wipes clean the UI and creates a new one based on the current values of the aforementioned shared state).
if this isn't how your UI code is currently designed... well, it ought to be.
okay thanks.
Now I had my grid working until I wanted to display the bombs remaining at the top.
I created a new panel and set the bombs remaining to a label then added the label to the panel by doing this
Code
bombPanel.add(Jbombs, BorderLayout.NORTH;
and now it displays the bomb count but only one button of the grid, right underneath it. Do I have to change something with the frame to accommodate another panel?
e/ Would I have to follow a pattern and set the grid to CENTER or something?
e2/ And I have no idea how to do what you said. This is my first real project if you haven't already noticed.
This post was edited by MachoMonkey89 on Jun 12 2012 05:08pm