As you could see on the previous picture, it was hard to read with the screen size so small. So I have created an array of JButtons and and array of JLabels with all the image icons both for the small icons and the larger icons.
The JButtons and the larger icons of JLabels will all be displayed in another frame, one where the user can see and read the tile.
And yes :D The prices are all in galleons ;P
FANDOM STYLE!
Welcome! Fandoms in the monopoly include Doctor Who, Sherlock, Merlin, Harry Potter, Lord of the Rings and Narnia. You'll see milestones while coding, errors that I have encountered, an "environmental message" , "computer science and careers" that might relate to this program, and how emerging areas of computer science might benefit from this program. Other things include errors that were encountered, the brainstorming before coding. Ryk, happy reading!
Sunday, 12 May 2013
Saturday, 11 May 2013
Finallies :D
HELLO AGAIN!
I shouldn't get too excited since I haven't done a whole lot, but I redid the code and it went by really quickly. So here's the updated picture of what the board looks like. And in the for loop, I've added everything to the mouseListener so it doesn't have to be done manually!
I shouldn't get too excited since I haven't done a whole lot, but I redid the code and it went by really quickly. So here's the updated picture of what the board looks like. And in the for loop, I've added everything to the mouseListener so it doesn't have to be done manually!
Thursday, 9 May 2013
And he does his thing again ;P
Ryk gave me another way to program the thing, so I'm going to change around my code again to accommodate that, cause it's a lot more efficient.
Basically, what his way, to do it was:
Use a class to extend all the JLabels.
To print all the for loops to the screen, name all the properties in order and a counter at the same number. Therefore, you can use a loop to create the labels (in an array), and do it individually for north, east, south and west.
He also said that it 'twas possible to do it for both east and west at the same time but I was too confuzzled..
Basically, what his way, to do it was:
Use a class to extend all the JLabels.
To print all the for loops to the screen, name all the properties in order and a counter at the same number. Therefore, you can use a loop to create the labels (in an array), and do it individually for north, east, south and west.
He also said that it 'twas possible to do it for both east and west at the same time but I was too confuzzled..
Hurray! :D
So I've finally finished the game board set up. I'm going to have to program the layeredPane part, so that when the pawns move, the user can see their pawns. But for now, at least, it's amazing
Now, I'm going to have to add all these labels into the class declaration where when the user clicks the properties, a frame will show up with the more massive pictures.
And I formatted it much better, so here is the official gameboard:
Now, I'm going to have to add all these labels into the class declaration where when the user clicks the properties, a frame will show up with the more massive pictures.
And I formatted it much better, so here is the official gameboard:
Tuesday, 7 May 2013
Size...
Okay, this is getting so irritating. I've made my labels this size:
And it's still not small enough for the whole board to come together.
so the size STILL has to be decreased significantly to fit 10 down the side -_-
And it's still not small enough for the whole board to come together.
so the size STILL has to be decreased significantly to fit 10 down the side -_-
Monday, 6 May 2013
Never Mind...
Oops..
I just dissected the entire reading of "How to use JLayered Panes"...
I just dissected the entire reading of "How to use JLayered Panes"...
- Swing Container with 2 depths
- Adding components to LayeredPanes - specify depth as an integer.
- Higher number is something that's closer to the top.
- Component Overlap: Closer Components have a larger depth than Farther Components.
- 2 Layered Panes
- JLayered Panes
- JDesktop Panes
- No Argument Constructor
- Adding Components and Setting the Depth
- createColoredLabel
- Opaque
- Background Colour
- Border
- Text
- Size
- add
- component to add
- integer object - specifying depth
- actual values don't matter. they are all relative values to the depth.
- depth
- components at higher depth are on top of the ones with a lower depth
- setLayer method (component, new depth, position within depth)
- setLayer method (component, new depth)
- Setting Component Position Within Depth
- Use Integer
- setLayer - int
- add (component, Integer, position within depth)
- Determine Componential Relationship
- Position between -1 and (n-1) means the number of components at that depth.
- The smaller the position number, the higher the component
- Using -1 is the same as (n-1) and it means the bottommost position
- Using 0 means the topmost position within the depth
- Layout Components
- Default: No layout manager
- setBounds (size, position)
- Possible to assign layouts (like borderLayout or gridLayout)
I think it makes much more sense.
So perhaps in that case, I'll make the gamePieces a depth of 1; and the pawns a depth of 3.
Layered Panes...
I was looking up JLayeredPanes on the JAVA API's and it says that it doesn't have it's own layout..but then it says that you can use a gridLayout so it all doesn't make any bloody sense!
ECK! -_-
And each of my components is 195, 295.
The examples are as confusing as heck and they, don't make any sense! >_<
And to make it worse than it is, the Java API says that the bottom most layer is referred to as the DEFAULT_LAYER; the second one the PALETTE_LAYER; the third one, the MODAL_LAYER; the fourth, the POPUP_LAYER, and the last, the DRAG_LAYER but the example on the Java Tutorials don't have any of those words! SO HOW ON EARTH DO YOU CREATE PANEL THAT GOES ON THE TOP? UGGH!
ECK! -_-
And each of my components is 195, 295.
The examples are as confusing as heck and they, don't make any sense! >_<
And to make it worse than it is, the Java API says that the bottom most layer is referred to as the DEFAULT_LAYER; the second one the PALETTE_LAYER; the third one, the MODAL_LAYER; the fourth, the POPUP_LAYER, and the last, the DRAG_LAYER but the example on the Java Tutorials don't have any of those words! SO HOW ON EARTH DO YOU CREATE PANEL THAT GOES ON THE TOP? UGGH!
Subscribe to:
Posts (Atom)