Search:

Type: Posts; User: Norm

Page 1 of 5 1 2 3 4

Search: Search took 0.11 seconds.

  1. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Create an executable jar file. On Windows with a JRE installed, double clicking in an executable jar file will start the program executing.
  2. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Sorry, I have no ideas how to do that.
  3. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    What is a "map"? A class? A file? A folder? ???
    Your description of your actions sounds like you are doing something with your IDE.
    I don't understand how to use your IDE and can not help you...
  4. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    The folder with the resources must be on the classpath. Is assets folder in a folder at the end of the classpath?

    If the path to an image file is: C:\AFolder\assets\afile.gif
    then the classpath...
  5. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Look at where they are when they have been split. Then you'll know.
    I assume that you know what an array is and how to access its elements.

    BTW the code in post#208 is poorly designed. The...
  6. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Put a special character between them when they are written.
    Use that character with the String class's split() method to separate them after the line has been read.
  7. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    The <>s were used to delimit some text for describing data. They are not part of the data or intended to be used in the program.

    post#201 had two sample lines that a program could have written to...
  8. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    You don't "apply meta data". It's a way of describing things in general terms when talking about data.
  9. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Did you read my last two posts? I described how to use a separator character to separate the parts/fields of the lines/records and use the split() method to get the separate fields.
  10. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    The text with <>s is meta data. The text inside the <>s describes a piece of data.
    The two line I posted were an example of how to use a special character ( ; ) to separate two fields in the...
  11. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    What needs to go in the file?
    One design would be to have a line/record for each board. Use a special character to separate the separate parts/fields. For example use a ;
    <FEN...
  12. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    You can write many FEN strings and descriptions to a text file. It is up to you to design a file layout to handle that.
  13. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Can each chess board can be represented by a FEN String?
    If not, what is missing?

    Save a FEN string for each board you want to save.
  14. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Do you need to save more than the FEN string? It can be used to create a position.
  15. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Do it in the class that controls what is shown in the JFrame if that is where you want to be able to change what is shown in the JFrame.
  16. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Is a "diagram" the GUI things that are shown in a component like a JPanel?

    Have you tried adding them to a scroll pane to see what happens?

    Or perhaps a CardLayout would be another way to allow...
  17. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Look at the Singleton pattern. It's an example of how to limit the number of instances of a classes that are created. The Singleton is for one, but the idea could be used for any number.

    Another...
  18. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    char variables are not objects, and don't have methods. The == operator is used to compare two char variables.
  19. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    the -- operator subtracts one from the variable. The same as row = row - 1


    Sorry, I don't understand what your problem is.
  20. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    That seems like the wrong way to do it. The program should reuse the objects, not create new ones.
  21. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    No, it is not a common problem.
    Try debugging with println() statements to see what the code is doing.
  22. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    I gave three solutions for the problem earlier.
    The second and third solutions put data into the object reference passed to the ActionListener method which could get that data and from it know...
  23. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    The methods should use the Square objects that have already been added to the ChessBoardView grid. There should not be methods that create new JLabels and add them.
  24. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Why change the Square objects after they have been put into the gridlayout?
    Reuse them. The JLabel class (That's what Square extends) has methods for changing its contents.
    Also the Square class...
  25. Thread: Chess Program

    by Norm
    Replies
    218
    Views
    15,106

    Re: Chess Program

    Make sure the variables have non-null values.
Results 1 to 25 of 107
Page 1 of 5 1 2 3 4