I have some txt files with characters. In my java programm im reading these files and depending what character is in each place, show an image in JPanel. Im checking the characters simply by if, if else, else statments. My question is if there is a better way to do it, because are aprox 10-11 different images.
posted 5 years ago
Use a HashMap and assign the key, value pairs by HashMap<Character, Image>