Create an executable jar file. On Windows with a JRE installed, double clicking in an executable jar file will start the program executing.
Type: Posts; User: Norm
Create an executable jar file. On Windows with a JRE installed, double clicking in an executable jar file will start the program executing.
Sorry, I have no ideas how to do that.
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...
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...
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...
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.
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...
You don't "apply meta data". It's a way of describing things in general terms when talking about data.
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.
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...
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...
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.
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.
Do you need to save more than the FEN string? It can be used to create a position.
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.
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...
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...
char variables are not objects, and don't have methods. The == operator is used to compare two char variables.
the -- operator subtracts one from the variable. The same as row = row - 1
Sorry, I don't understand what your problem is.
That seems like the wrong way to do it. The program should reuse the objects, not create new ones.
No, it is not a common problem.
Try debugging with println() statements to see what the code is doing.
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...
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.
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...
Make sure the variables have non-null values.