If you want to count how many times each letter appears you can see if it already existed and, if it existed, add it to an array where you save how many times it appears. So you would have an array of Booleans to see if it already exists and another Integers to see how many times it appears.
Following your code, what you are looking for is something like this:
public static void main(String[] args) {
String cadena="";
char [] Arraycadena ;
char caracter;
System.out.println("Introduce una palabra");
cadena=Leer.dato();
Arraycadena=cadena.toCharArray();
boolean[] yaEstaElCaracter = new boolean[Character.MAX_VALUE];
int[] cuantasVeces = new int[Character.MAX_VALUE];
for(int i =0;i<Arraycadena.length;i++){
caracter = Arraycadena[i];
if(Arraycadena[i]==caracter){
cuantasVeces[caracter]++;
}
yaEstaElCaracter[caracter] = true;
}//Fin Para
for(int i = 0; i < yaEstaElCaracter.length; i++){
if(yaEstaElCaracter[i])
System.out.println((char) i +" "+cuantasVeces[i]+" veces.");
}
}
EDITION:
To show them in order I think a less elegant solution, is that you move the array forward and go eliminating the letters that have already appeared and inserting a character that should never appear (for example the blank space and thus can also serve to count characters of a sentence).
It would stay like this:
public static void main(String[] args) {
String cadena="";
char [] Arraycadena ;
char caracter;
System.out.println("Introduce una palabra");
cadena=Leer.dato();
Arraycadena=cadena.toCharArray();
char[] caracteres = new char[cadena.length()];
int[] cuantasVeces = new int[cadena.length()];
for(int i =0;i<Arraycadena.length;i++){
caracter = Arraycadena[i];
caracteres[i] = caracter;
for(int j = i; j < Arraycadena.length; j++) {
if(Arraycadena[j]==caracter){
cuantasVeces[i]++;
Arraycadena[j] = ' ';
}
}
if(caracteres[i] != ' ')
System.out.println(caracteres[i] +" "+cuantasVeces[i]+" veces.");
}
}
Example of output:
Entrada:
RATA
Salida:
R 1 veces.
A 2 veces.
T 1 veces.
Example with a phrase:
Entrada:
TARTA DE RATA
Salida:
T 3 veces.
A 4 veces.
R 2 veces.
D 1 veces.
E 1 veces.