Ranchers need some help.
I am given a project in MVC with Swings.
I should develop a system's front end where the user is asked for his username and password. When he enters them correctly then he's asked a random question from a database which if he answers correctly will be logged in.
I have already done them using Swings but without MVC.( I hide the 1. Login page when the username and password and display 2. Random Question Page)
1. Login Page
2. Random Question
As I have started converting it to MVC I created a View, Controller and Model files for the login page.
I have created a second View file for the Random Question page and am planning to use the same controller and model file.( I dont know if its ok do it)
My questions are ,
a. Can I some how refresh the 1. Login Page and display 2. Random Question in the same window or do I have to use second View file?
b. How to add actionlisteners for radio buttons in MVC?
c. How to call the second view file and from where?
Code
View file:
Controller:
Model:
The program is not complete, but when I run I am displayed 1. Login page when I enter the correct username and password, it hides view1 but a NULL pointer error is shown and wont display 2. Random question view.
Any help/suggestion is welcome.
Thanks in advance!