Search:

Type: Posts; User: gokuball

Page 1 of 2 1 2

Search: Search took 0.10 seconds.

  1. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    Ofcourse, shall i post the chessboardview class this is the class that contains the gridlayout(8,8) and contains the JLabels



    package view;

    import java.awt.*;

    import java.util.ArrayList;
  2. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    2240

    any idea how i can get rid of the white space between the jlabels
  3. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    private void setSquareColors(){
    for(Square square: squares){
    if(square.toString().matches("A1|C1|E1|G1|B2|D2|F2|"
    + "H2|A3|C3|E3|G3|B4|D4|F4|H4|A5|C5|E5|G5|"
    +...
  4. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    previous page shows the code of the classes



    and how do i do that? the gridlayout doesn't know which row or collum i am in right?
    thanks for you help!

    --- Update ---

    I go to test all...
  5. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    I fixed it! the squares are in the right position. But how do i set the color right for each square. A1 = brown for instance B1 = white C1 = brown etc
  6. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    which method are you talking about?

    --- Update ---

    can you please post the code you made to get to the point of the grid with all the labels and icons in it
  7. Replies
    0
    Views
    1,601

    POSSIBLE TO CHANGE PROFILE NAME?

    hi guys

    want to change my profile name GokuBall is that possible? and how?
  8. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    can you post the code?
  9. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    how did you get that? which code?



    private void createGUI() {
    Dimension boardSize = new Dimension(200, 200);

    setLayout( new GridLayout(8, 8) );
    setPreferredSize( boardSize );...
  10. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    private void addImageToSquare() {

    for(int i = 0; i < 64; i++){
    if (chessboard.getSquare(i).getColor().equals("WHITE")){
    chessboard.getSquare(i).setImage(LIGHT_BROWN);
    }...
  11. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    I dont know which JLabels


    public class ChessBoard {

    private Set<ChessPiece> chessPieces;
    private ArrayList<Square> squares;
    private static final String[] LOCATIONS = {
    ...
  12. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    what do you mean by what order? thanks for you help!


    public class ChessBoardView extends JPanel
    {
    //intialize variables
    private final static ImageIcon DARK_BROWN = new ImageIcon ...
  13. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    i dont know how to change a gridlayout so it contains 64 jlabels in the right order
  14. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    how do i change a grid logic so the labels are set correctly?
  15. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    the location value and the color and image are set correctly the arraylist contains 64 squares with string location, string color, ImageIcon image. Now in the chessboardview which extends...
  16. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    i need something like


    for (int i = 0; i < 64; i++) {


    int row = (i / 8) % 2;
    if (row == 0)
  17. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    Okay i made my square class JLabel what next? I have 64 different square objects, each with different locations.



    import javax.swing.JLabel;

    public class Square extends JLabel{


    but what...
  18. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Re: Chess Program

    can you code an example for me?

    --- Update ---



    i all ready have that right?
  19. Thread: Chess Program

    by gokuball
    Replies
    218
    Views
    15,182

    Chess Program

    Guys,

    I am developing a chess manager program(not an interactive game)!

    I have the following classes in my model package

    ChessPieces
    ChessBoard contains Squares in an ArrayList and...
  20. Thread: ArrayList

    by gokuball
    Replies
    3
    Views
    1,434

    Re: ArrayList

    ArrayList<Object> objects = new ArrayList<Object>();
  21. Thread: ArrayList

    by gokuball
    Replies
    3
    Views
    1,434

    ArrayList

    Is there a way to use an ArrayList which hold objects but not specific objects. Something like anonymous objects. For instance you dont know which objects its gonna be you just want that arraylist to...
  22. Replies
    13
    Views
    1,366

    Re: Important need some guidance & tips/tricks!

    why do i get this error:

    Exception in thread "main" java.lang.NullPointerException
    at view.ChessBoardView.<init>(ChessBoardView.java:38)
    at controller.Controller.makeFrame(Controller.java:43)...
  23. Replies
    13
    Views
    1,366

    Re: Important need some guidance & tips/tricks!

    Can you be more positive since i am trying to learn.. dont think there are stupid questions only the dumb answer is what make people uncertain
  24. Replies
    13
    Views
    1,366

    Re: Important need some guidance & tips/tricks!

    Oke! and maybe as you pointed earlier its good to use locations for the chess like a1 b1 c1 etc.. how can i do this the best make an array with these values.

    --- Update ---

    Okay so i want to...
  25. Replies
    13
    Views
    1,366

    Re: Important need some guidance & tips/tricks!

    Anyone know a good technique to make a chessboard? which contains squares. An array is not possible since it can not contain objects. I need 64 square objects in a collection which one? i also make a...
Results 1 to 25 of 38
Page 1 of 2 1 2