Java - Problema con check y mouseclick

 
Vista:
Imágen de perfil de Gustavo J.

Problema con check y mouseclick

Publicado por Gustavo J. (3 intervenciones) el 15/10/2014 14:39:35
Intento cargar datos correspondientes a checks con días de la semana a través de datos que se encuentran en una tabla visible dentro del formulario. El código hace lo que necesito, pero en el output me muestra un error, con lo que el formulario deja de funcionar correctamente. Dejo el código, y el mensaje de error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
public void mouseClicked(MouseEvent e) {
        if (e.getButton() == 1) {
            int fila = this.vista.tablaItinerario.rowAtPoint(e.getPoint());
            if (fila > -1) {
                this.vista.txtNumero.setText(String.valueOf(this.vista.tablaItinerario.getValueAt(fila, 0)));
                this.vista.comboOrigen.setSelectedItem(String.valueOf(this.vista.tablaItinerario.getValueAt(fila, 1)));
                this.vista.comboDestino.setSelectedItem(String.valueOf(this.vista.tablaItinerario.getValueAt(fila, 2)));
                this.vista.txtSalida.setText(String.valueOf(this.vista.tablaItinerario.getValueAt(fila, 3)));
                this.vista.txtLlegada.setText(String.valueOf(this.vista.tablaItinerario.getValueAt(fila, 4)));
                this.vista.comboDias.setSelectedItem( String.valueOf(this.vista.tablaItinerario.getValueAt(fila, 5)));
                this.vista.txtCosto.setText(String.valueOf(this.vista.tablaItinerario.getValueAt(fila, 6)));
                habtxt();
                this.vista.comboOrigen.requestFocus();
                habtn();
            }
        }
        String dia[] = this.vista.comboDias.getSelectedItem().toString().split("-");
         int cant=0;
         int tot=7;
         while (cant<=tot) {
            switch (dia[cant]) {
                case "lu":
                    this.vista.boxlunes.setSelected(true);
                    break;
                case "ma":
                    this.vista.boxmartes.setSelected(true);
                    break;
                case "mi":
                    this.vista.boxmiercoles.setSelected(true);
                    break;
                case "ju":
                    this.vista.boxjueves.setSelected(true);
                    break;
                case "vi":
                    this.vista.boxviernes.setSelected(true);
                    break;
                case "sa":
                    this.vista.boxsabado.setSelected(true);
                    break;
                case "do":
                    this.vista.boxdomingo.setSelected(true);
                    break;
            }
         cant=cant+1;
     }
    }

Captura_de_pantalla_11
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder