0

What can I do to appear a dialog box asking the user to enter the number of students... (the highlighted part)![enter image description here][1]

    JOptionPane.showMessageDialog(null, "Welcome");
    JOptionPane.showMessageDialog(null, "Students mark Input Project");
    JOptionPane.showMessageDialog(null, "In this program the user is going to enter the students name, class and marks.Then the program is going to output several information about each student.");
    JOptionPane.showMessageDialog(null, "Class Information must be entered as the name of the class, the subject and the number of students");
    String nameofclass = JOptionPane.showInputDialog("Enter the name of the class");
    String nameofsubject = JOptionPane.showInputDialog("Enter the subject"); 
    int numberofstudents =Integer.parseInt("Enter the number of students");
    JOptionPane.showMessageDialog(null,"Class Students Information");
    JOptionPane.showMessageDialog(null,"You must enter the name, surname and " + nameofsubject + " marks for each and every student in class "+ nameofclass);
    StLuciaClassrooms theclass =new StLuciaClassrooms(nameofclass, numberofstudents);
    theclass.enterInformation(numberofstudents);//
2
  • The image is missing. What does this have to do with either JavaScript or JEE? Commented Nov 16, 2013 at 12:05
  • 1
    int numberofstudents =Integer.parseInt("Enter the number of students"); Hmmm, not good. Commented Nov 16, 2013 at 12:06

1 Answer 1

1

try this

 int numberofstudents =Integer.parseInt(JOptionPane.showInputDialog("Enter the number of students"));
Sign up to request clarification or add additional context in comments.

1 Comment

you should accept the answer by clicking the tick mark on the left side of the answer if you think it satisfied your question. This is how the site works. And welcome to Stack Overflow

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.