Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void mostrarLoader() {
- this.euskoFlixLoader = new EuskoFlixLoader();
- this.euskoFlixLoader.setVisible(true);
- }
- private void cerrarLoader() {
- this.euskoFlixLoader.setVisible(false);
- this.euskoFlixLoader.dispose();
- this.euskoFlixLoader = null;
- }
- class LoguearseListener implements ActionListener{
- @Override
- public void actionPerformed(ActionEvent e) {
- int username = ventanaLogin.getUsuario();
- if (username != Integer.MIN_VALUE) {
- ventanaLogin.setVisible(false);
- mostrarLoader();
- Usuario user = CatalogoUsuarios.getInstance().login(new Usuario(username, "", "", ventanaLogin.getContra()));
- if (user == null) {
- cerrarLoader();
- ventanaLogin.setVisible(true);
- JOptionPane.showMessageDialog(ventanaLogin,
- "Usuario o contraseña incorrecto.", "Error login",
- JOptionPane.ERROR_MESSAGE);
- } else {
- ventanaLogin.dispose();
- Object[][] vistas = this.generarInfoPelis(MatrizValoraciones.getInstance().getPeliculasVistas(username).toIntegerArray());
- Object[][] recomendadas = this.generarInfoPelis(Filtrado.getInstance().recomendar(TipoRecomendacion.Hibrido, 10).toIntegerArray());
- cerrarLoader();
- new VentanaUsuario(user.usuarioToStringArray(), vistas,recomendadas);
- }
- } else {
- JOptionPane.showMessageDialog(ventanaLogin,
- "Usuario o contraseña incorrecto.", "Error login",
- JOptionPane.ERROR_MESSAGE);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement