Good friends programmers, I have a situation: I am transforming a program that uses System.out.println
to print on the screen and I must convert it into its consequent graphic part.
Part of the code that I need to transform is:
public int getCart(int num) {
PantallaJuego pj = new PantallaJuego();
int getCart = 0;
switch (num) {
case 0: //Valor del arreglo
System.out.println("1");//carta a imprimir
getCart = 1; //Es el valor temporal para asignar para la suma
break;
case 1: //Valor del arreglo
System.out.println("2");//carta a imprimir
getCart = 2; //Es el valor temporal para asignar para la suma
break;
case 2:
System.out.println("3");
getCart = 3;
break;
But I need to take those outputs and enter them in JLabel
, how could I transform it?
I appreciate the suggestions!