Skip to content

Instantly share code, notes, and snippets.

@TheBeachMaster
Created February 10, 2015 12:59
Show Gist options
  • Save TheBeachMaster/dd264fa773be95c8972f to your computer and use it in GitHub Desktop.
Save TheBeachMaster/dd264fa773be95c8972f to your computer and use it in GitHub Desktop.
This is a simple Java application showing how to use the JOption Panes
package com.details.students;
import javax.swing.*;
public class StudentDetails {
public static void main(String[] args) {
// write your code here
String name,regno,course,module,year,sem;
name= JOptionPane.showInputDialog("Hello Enter Your Name");
regno= JOptionPane.showInputDialog(null,"Hi "+name+" enter your Reg Number",name,JOptionPane.PLAIN_MESSAGE);
course= JOptionPane.showInputDialog(null,name+" enter your course name:",name+"'s Course",JOptionPane.PLAIN_MESSAGE);
module= JOptionPane.showInputDialog(null,"Hello "+name+" which Module are you?",name+"'s Module",JOptionPane.PLAIN_MESSAGE);
year= JOptionPane.showInputDialog(null,"Hi "+name+" enter your year in your "+course+" course",name+"'s Year",JOptionPane.PLAIN_MESSAGE);
sem= JOptionPane.showInputDialog(null,name+" please enter your semester progress in "+course,name+"'s Semester",JOptionPane.PLAIN_MESSAGE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment