Smart Portal | Complete Software for University

Screenshots











Source Code




Class No.1

import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.ImageIcon;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.SystemColor;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Welcome extends JFrame {

// The main executional part of the whole the software
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Welcome frame = new Welcome();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

//constructor for the class
public Welcome() {
setResizable(false);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
// if some one wants to close by red cross
int exit =JOptionPane.showConfirmDialog(null, "Do you really want to exit ??");
if (exit==0)
dispose();
else if (exit ==1 || exit==2)
{
Welcome frame = new Welcome();
frame.setVisible(true);
}
}
});
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setTitle("Welcome to Hajvery University");
setBounds(100, 100, 469, 340);
getContentPane().setLayout(null);
JButton btnContinue = new JButton("Continue");
btnContinue.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// for continue
StdOrTeach SorT= new StdOrTeach();
SorT.setVisible(true);
dispose();
}
});
btnContinue.setBackground(SystemColor.info);
btnContinue.setBounds(0, 288, 464, 23);
getContentPane().add(btnContinue);
JLabel lblUniLogo = new JLabel("");
lblUniLogo.setBounds(0, 0, 464, 288);
lblUniLogo.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\Hajvery-university-admissions.jpg"));
getContentPane().add(lblUniLogo);

}

}


Class No.2

import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import java.awt.Color;
import java.awt.Font;
import javax.swing.border.LineBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.border.BevelBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.SwingConstants;

public class StdOrTeach extends JFrame {

private JPanel contentPane;



public StdOrTeach() {
setResizable(false);
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setTitle("HU is a charterted by Govt. of Punjab");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 627, 408);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);

JPanel panel = new JPanel();
panel.setBackground(new Color(255, 255, 255));
panel.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
panel.setBounds(10, 22, 600, 344);
contentPane.add(panel);
panel.setLayout(null);

JButton btnImTeach = new JButton("I'm Teacher");
btnImTeach.setBounds(211, 251, 157, 65);
panel.add(btnImTeach);
btnImTeach.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// create object
TeachLogin Tlogin = new TeachLogin();
Tlogin.setVisible(true);
dispose();

}
});
btnImTeach.setBackground(Color.WHITE);
btnImTeach.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\male-teacher-clip-art.jpg"));

JButton btnImAdmin = new JButton("I'm Admin");
btnImAdmin.setBounds(405, 251, 157, 65);
btnImAdmin.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\Administrator.png"));
btnImAdmin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// create object of the class
AdminLogin Alogin = new AdminLogin();
Alogin.setVisible(true);
dispose();
}

});
btnImAdmin.setBackground(Color.WHITE);
panel.add(btnImAdmin);

JLabel lblNewLabel_1 = new JLabel("");
lblNewLabel_1.setBounds(182, 11, 254, 201);
lblNewLabel_1.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\timthumb.jpg"));
panel.add(lblNewLabel_1);

JButton btnImStd = new JButton("I'm Student");
btnImStd.setBounds(23, 251, 155, 65);
panel.add(btnImStd);
btnImStd.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

StdLogin Slogin =new StdLogin();
Slogin.setVisible(true);
dispose();
}
});
btnImStd.setBackground(Color.WHITE);
btnImStd.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\std.PNG"));

JLabel lblTitle = new JLabel("Please select from the following");
lblTitle.setHorizontalAlignment(SwingConstants.CENTER);
lblTitle.setBounds(127, 202, 309, 50);
panel.add(lblTitle);
lblTitle.setFont(new Font("Monotype Corsiva", Font.PLAIN, 22));
}
}

Class No.3

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.BevelBorder;
import java.awt.Color;
import javax.swing.border.EtchedBorder;
import javax.swing.border.LineBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import java.awt.SystemColor;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class StdLogin extends JDialog {

private final JPanel contentPanel = new JPanel();
private JTextField tfUserName;
private JPasswordField passwordField;
private String uName="23526";
private String pWord="java";


public StdLogin()
{
setResizable(false);
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setTitle("Studnet Login");
setBounds(100, 100, 442, 280);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
JPanel panel = new JPanel();
panel.setBorder(new LineBorder(Color.LIGHT_GRAY, 2, true));
panel.setBounds(195, 25, 206, 143);
contentPanel.add(panel);
panel.setLayout(null);
{
JLabel lblUserName = new JLabel("Roll No.");
lblUserName.setBounds(24, 26, 149, 14);
panel.add(lblUserName);
}
{
tfUserName = new JTextField();
tfUserName.setBounds(24, 46, 149, 20);
panel.add(tfUserName);
tfUserName.setColumns(10);
}
{
JLabel lblPw = new JLabel("Password");
lblPw.setBounds(24, 87, 149, 14);
panel.add(lblPw);
}
{
passwordField = new JPasswordField();
passwordField.setBounds(24, 110, 149, 20);
panel.add(passwordField);
}
JPanel panel_1 = new JPanel();
panel_1.setBackground(SystemColor.window);
panel_1.setBorder(new LineBorder(Color.LIGHT_GRAY, 2));
panel_1.setBounds(0, 11, 434, 165);
contentPanel.add(panel_1);
panel_1.setLayout(null);
{
JLabel lblUniLogo = new JLabel("");
lblUniLogo.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\12107964_10153161750172688_8872249596591658378_n.jpg"));
lblUniLogo.setBounds(41, 25, 100, 116);
panel_1.add(lblUniLogo);
}
{
JButton btnLogin = new JButton("");
btnLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// condition for check correct user name and password
if (tfUserName.getText().equalsIgnoreCase(uName) && passwordField.getText().equalsIgnoreCase(pWord))
{
MainInter m = new MainInter();
m.setVisible(true);
dispose();
}
else
JOptionPane.showMessageDialog(null, "Please enter a valid Id and Password");
}
});
btnLogin.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\btn login.PNG"));
btnLogin.setBounds(148, 187, 147, 47);
contentPanel.add(btnLogin);
}
}
}

Class No.4

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.BevelBorder;
import java.awt.Color;
import javax.swing.border.EtchedBorder;
import javax.swing.border.LineBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import java.awt.SystemColor;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class TeachLogin extends JDialog {

private final JPanel contentPanel = new JPanel();
private JTextField tfUserName;
private JPasswordField passwordField;

private String uName="05";
private String pWord="java";


public TeachLogin() 
{
setResizable(false);
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setTitle("Teacher Login");
setBounds(100, 100, 445, 282);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
JPanel panel = new JPanel();
panel.setBorder(new LineBorder(Color.LIGHT_GRAY, 2, true));
panel.setBounds(195, 25, 206, 143);
contentPanel.add(panel);
panel.setLayout(null);
{
JLabel lblUserName = new JLabel("Teacher's ID");
lblUserName.setBounds(24, 26, 149, 14);
panel.add(lblUserName);
}
{
tfUserName = new JTextField();
tfUserName.setBounds(24, 46, 149, 20);
panel.add(tfUserName);
tfUserName.setColumns(10);
}
{
JLabel lblPw = new JLabel("Password");
lblPw.setBounds(24, 87, 149, 14);
panel.add(lblPw);
}
{
passwordField = new JPasswordField();
passwordField.setBounds(24, 110, 149, 20);
panel.add(passwordField);
}
JPanel panel_1 = new JPanel();
panel_1.setBackground(SystemColor.window);
panel_1.setBorder(new LineBorder(Color.LIGHT_GRAY, 2));
panel_1.setBounds(0, 11, 434, 165);
contentPanel.add(panel_1);
panel_1.setLayout(null);
{
JLabel lblUniLogo = new JLabel("");
lblUniLogo.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\12107964_10153161750172688_8872249596591658378_n.jpg"));
lblUniLogo.setBounds(41, 25, 100, 116);
panel_1.add(lblUniLogo);
}
{
JButton btnLogin = new JButton("");
btnLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (tfUserName.getText().equalsIgnoreCase(uName) && passwordField.getText().equalsIgnoreCase(pWord))
{
MainInter m = new MainInter();
m.setVisible(true);
dispose();
}
else
JOptionPane.showMessageDialog(null, "Please enter a valid Id and Password");
}
});
btnLogin.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\btn login.PNG"));
btnLogin.setBounds(148, 187, 147, 47);
contentPanel.add(btnLogin);
}
}
}


Class No.5

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.BevelBorder;
import java.awt.Color;
import javax.swing.border.EtchedBorder;
import javax.swing.border.LineBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import java.awt.SystemColor;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class AdminLogin extends JDialog {

private final JPanel contentPanel = new JPanel();
private JTextField tfUserName;
private JPasswordField passwordField;
// the password and username
private String uName="1122";
private String pWord="java";



public AdminLogin() 
{
setResizable(false);
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setTitle("Admin Login");
setBounds(100, 100, 445, 282);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
JPanel panel = new JPanel();
panel.setBorder(new LineBorder(Color.LIGHT_GRAY, 2, true));
panel.setBounds(195, 25, 206, 143);
contentPanel.add(panel);
panel.setLayout(null);
{
JLabel lblUserName = new JLabel("Officer's ID");
lblUserName.setBounds(24, 26, 149, 14);
panel.add(lblUserName);
}
{
tfUserName = new JTextField();
tfUserName.setBounds(24, 46, 149, 20);
panel.add(tfUserName);
tfUserName.setColumns(10);
}
{
JLabel lblPw = new JLabel("Password");
lblPw.setBounds(24, 87, 149, 14);
panel.add(lblPw);
}
{
passwordField = new JPasswordField();
passwordField.setBounds(24, 110, 149, 20);
panel.add(passwordField);
}
JPanel panel_1 = new JPanel();
panel_1.setBackground(SystemColor.window);
panel_1.setBorder(new LineBorder(Color.LIGHT_GRAY, 2));
panel_1.setBounds(0, 11, 434, 165);
contentPanel.add(panel_1);
panel_1.setLayout(null);
{
JLabel lblUniLogo = new JLabel("");
lblUniLogo.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\12107964_10153161750172688_8872249596591658378_n.jpg"));
lblUniLogo.setBounds(41, 25, 100, 116);
panel_1.add(lblUniLogo);
}
{
JButton btnLogin = new JButton("");
btnLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (tfUserName.getText().equalsIgnoreCase(uName) && passwordField.getText().equalsIgnoreCase(pWord))
{
MainInter m = new MainInter();
m.setVisible(true);
dispose();

}
else
//dialog box for the error
JOptionPane.showMessageDialog(null, "Please enter a valid Id and Password");
}
});
btnLogin.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\btn login.PNG"));
btnLogin.setBounds(148, 187, 147, 47);
contentPanel.add(btnLogin);
}
}
}

Class No.6

import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.border.SoftBevelBorder;
import javax.swing.border.BevelBorder;
import javax.swing.JLabel;
import javax.swing.JSpinner;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import java.awt.Font;
import java.awt.Color;
import javax.swing.UIManager;
import javax.swing.SwingConstants;
import java.awt.Toolkit;

public class MainInter extends JFrame {

private JPanel contentPane;


public MainInter() {
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setTitle("Welcome to HU portal");
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 636, 585);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnExamDepart = new JButton("Examination");
btnExamDepart.setBackground(Color.WHITE);
btnExamDepart.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\midterm-clipart-exam-clipart.jpg"));
btnExamDepart.addActionListener(new ActionListener() {
// this action is perform after pressing button
public void actionPerformed(ActionEvent e) {
Exam ex = new Exam ();
ex.setVisible(true);
dispose();
}
});
btnExamDepart.setBounds(367, 189, 193, 54);
contentPane.add(btnExamDepart);
JButton btnAcc = new JButton("Accounts");
btnAcc.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
AccountStd Ac = new AccountStd();
Ac.setVisible(true);
dispose();
}
});
btnAcc.setBackground(Color.WHITE);
btnAcc.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\1313015812_Vector_Clipart.png"));
btnAcc.setBounds(367, 274, 193, 54);
contentPane.add(btnAcc);
JButton btnRegis = new JButton("Registration");
btnRegis.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Registration r= new Registration();
r.setVisible(true);
dispose();
}
});
btnRegis.setBackground(Color.WHITE);
btnRegis.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\cash-register-clip-art-free-895795.png"));
btnRegis.setBounds(367, 362, 193, 54);
contentPane.add(btnRegis);
JPanel panel = new JPanel();
panel.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
panel.setBounds(10, 11, 610, 512);
contentPane.add(panel);
panel.setLayout(null);
JButton btnNewButton = new JButton("SignOut");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Welcome w = new Welcome();
w.setVisible(true);
dispose();
}
});
btnNewButton.setBackground(new Color(245, 245, 220));
btnNewButton.setBounds(10, 11, 80, 14);
panel.add(btnNewButton);
JLabel lblNewLabel_1 = new JLabel("The Hajvery University");
lblNewLabel_1.setForeground(Color.RED);
lblNewLabel_1.setFont(new Font("Urdu Typesetting", Font.ITALIC, 27));
lblNewLabel_1.setBounds(162, 71, 269, 55);
panel.add(lblNewLabel_1);
JLabel lblNewLabel_2 = new JLabel("Lahore, Pakistan");
lblNewLabel_2.setFont(new Font("Sitka Display", Font.PLAIN, 23));
lblNewLabel_2.setBounds(213, 131, 155, 20);
panel.add(lblNewLabel_2);
JPanel panel_1 = new JPanel();
panel_1.setBorder(UIManager.getBorder("InternalFrame.border"));
panel_1.setBounds(43, 61, 524, 108);
panel.add(panel_1);
panel_1.setBackground(Color.WHITE);
JLabel lblNewLabel_3 = new JLabel("");
lblNewLabel_3.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_3.setBackground(Color.DARK_GRAY);
lblNewLabel_3.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\12107964_10153161750172688_8872249596591658378_n.jpg"));
lblNewLabel_3.setBounds(96, 192, 129, 128);
panel.add(lblNewLabel_3);
JLabel lblSmartPortal = new JLabel("Smart Portal");
lblSmartPortal.setHorizontalAlignment(SwingConstants.CENTER);
lblSmartPortal.setForeground(Color.BLUE);
lblSmartPortal.setFont(new Font("Urdu Typesetting", Font.ITALIC, 27));
lblSmartPortal.setBounds(64, 309, 192, 46);
panel.add(lblSmartPortal);
JLabel lblAccessIsEasy = new JLabel("Access is easy now");
lblAccessIsEasy.setHorizontalAlignment(SwingConstants.CENTER);
lblAccessIsEasy.setForeground(new Color(0, 0, 0));
lblAccessIsEasy.setFont(new Font("Urdu Typesetting", Font.ITALIC, 27));
lblAccessIsEasy.setBounds(30, 348, 269, 46);
panel.add(lblAccessIsEasy);
JButton btnExit = new JButton("Exit");
btnExit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// dispose(); is the built-in method for remove the current jframe from the memory
dispose();
}
});
btnExit.setForeground(new Color(0, 0, 0));
btnExit.setBackground(new Color(250, 240, 230));
btnExit.setBounds(444, 487, 105, 14);
panel.add(btnExit);
JButton btnFeedback = new JButton("Feedback");
btnFeedback.setForeground(new Color(0, 0, 0));
btnFeedback.setBackground(new Color(250, 240, 230));
btnFeedback.setBounds(64, 487, 102, 14);
panel.add(btnFeedback);
JButton btnContactUs = new JButton("Setting");
btnContactUs.setForeground(new Color(0, 0, 0));
btnContactUs.setBackground(new Color(250, 240, 230));
btnContactUs.setBounds(176, 487, 80, 14);
panel.add(btnContactUs);
JButton btnAccInfo = new JButton("Acc info");
btnAccInfo.setForeground(new Color(0, 0, 0));
btnAccInfo.setBackground(new Color(250, 240, 230));
btnAccInfo.setBounds(264, 487, 80, 14);
panel.add(btnAccInfo);
JButton btnHelp = new JButton("Help");
btnHelp.setForeground(new Color(0, 0, 0));
btnHelp.setBackground(new Color(250, 240, 230));
btnHelp.setBounds(354, 487, 80, 14);
panel.add(btnHelp);
JLabel lblNewLabel = new JLabel("All rights are reserved. It is product released by Let's Programming.");
lblNewLabel.setBounds(20, 534, 289, 14);
contentPane.add(lblNewLabel);
}
}

Class No.7

//libraries 
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.Font;
import javax.swing.SwingConstants;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Toolkit;

public class AccountStd extends JFrame {

private JPanel contentPane;

// constructor of the class
public AccountStd() {
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setTitle("Your fee details");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 551);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\small.png"));
lblNewLabel.setBounds(10, 11, 100, 100);
contentPane.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("Total Fee ");
lblNewLabel_1.setFont(new Font("Tahoma", Font.BOLD, 13));
lblNewLabel_1.setBounds(104, 194, 100, 25);
contentPane.add(lblNewLabel_1);
JLabel lblPaidFee = new JLabel("Paid Fee");
lblPaidFee.setFont(new Font("Tahoma", Font.BOLD, 13));
lblPaidFee.setBounds(104, 251, 100, 25);
contentPane.add(lblPaidFee);
JLabel lblRemaining = new JLabel("Remaining");
lblRemaining.setFont(new Font("Tahoma", Font.BOLD, 13));
lblRemaining.setBounds(104, 313, 100, 25);
contentPane.add(lblRemaining);
JLabel lblNewLabel_2 = new JLabel("Rs. 60,000");
lblNewLabel_2.setBounds(241, 200, 137, 14);
contentPane.add(lblNewLabel_2);
JLabel label = new JLabel("Rs. 60,000");
label.setBounds(241, 257, 137, 14);
contentPane.add(label);
JLabel lblRs = new JLabel("Rs. 0");
lblRs.setBounds(241, 319, 137, 14);
contentPane.add(lblRs);
JLabel lblNewLabel_3 = new JLabel("Fee Details");
lblNewLabel_3.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_3.setFont(new Font("Tahoma", Font.PLAIN, 18));
lblNewLabel_3.setBounds(134, 120, 137, 25);
contentPane.add(lblNewLabel_3);
JPanel panel = new JPanel();
panel.setBackground(Color.WHITE);
panel.setBounds(0, 172, 434, 210);
contentPane.add(panel);
JButton btnNewButton = new JButton("Back");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// goto next page
MainInter m = new MainInter();
        m.setVisible(true);
        // to remove previous page
        dispose();
}
});
btnNewButton.setBounds(0, 489, 73, 23);
contentPane.add(btnNewButton);
}

}


Class No.8

import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import java.awt.Font;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.ButtonGroup;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextField;
import javax.swing.JRadioButton;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Toolkit;

public class Registration extends JFrame {
// member variables (of global level)
private JPanel contentPane;
private JTextField textField;
private JTextField textField_1;
private JTextField textField_3;
private JTextField textField_4;
private JTextField textFieldName;
private JTextField txtRollNo;
private JTextField txtMarks;
private JTextField txtBoard;
private JTextField txtYear;
private JTextField textField_2;
private JTextField textField_6;
private JTextField textField_7;
private JTextField textField_8;
private JTextField textField_9;
private JTextField textField_10;
private JTextField textField_11;
private JTextField textField_12;


public Registration() {
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setResizable(false);
setTitle("Registration");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 568, 709);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("Registration");
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 20));
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setBounds(194, 111, 186, 36);
contentPane.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("");
lblNewLabel_1.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\small.png"));
lblNewLabel_1.setBounds(10, 11, 103, 100);
contentPane.add(lblNewLabel_1);
JLabel lblNewLabel_2 = new JLabel("Name");
lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblNewLabel_2.setBounds(42, 184, 55, 23);
contentPane.add(lblNewLabel_2);
JLabel lblFathersName = new JLabel("Father's Name");
lblFathersName.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblFathersName.setBounds(42, 218, 103, 23);
contentPane.add(lblFathersName);
JLabel lblCnicNo = new JLabel("ID Card/Bay foam");
lblCnicNo.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblCnicNo.setBounds(42, 252, 103, 23);
contentPane.add(lblCnicNo);
JLabel lblTelephoneNo = new JLabel("Telephone No.");
lblTelephoneNo.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblTelephoneNo.setBounds(42, 320, 103, 23);
contentPane.add(lblTelephoneNo);
JLabel lblEmail = new JLabel("E-mail");
lblEmail.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblEmail.setBounds(42, 354, 103, 23);
contentPane.add(lblEmail);
JLabel lblGender = new JLabel("Gender");
lblGender.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblGender.setBounds(42, 286, 103, 23);
contentPane.add(lblGender);
JLabel lblDiscipline = new JLabel("Discipline");
lblDiscipline.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblDiscipline.setBounds(42, 388, 103, 23);
contentPane.add(lblDiscipline);
JComboBox comboBox = new JComboBox();
comboBox.setBackground(Color.WHITE);
// list given for selection in comoBox
comboBox.setModel(new DefaultComboBoxModel(new String[] {"Computer Studies", "Business Studies", "Media Studies", "Pharma Studies", "Fashion Studies", "Management Studies"}));
comboBox.setBounds(206, 390, 248, 20);
contentPane.add(comboBox);
textField = new JTextField();
textField.setBounds(206, 356, 248, 20);
contentPane.add(textField);
textField.setColumns(10);
textField_1 = new JTextField();
textField_1.setColumns(10);
textField_1.setBounds(206, 322, 248, 20);
contentPane.add(textField_1);
textField_3 = new JTextField();
textField_3.setColumns(10);
textField_3.setBounds(206, 254, 248, 20);
contentPane.add(textField_3);
textField_4 = new JTextField();
textField_4.setColumns(10);
textField_4.setBounds(206, 220, 248, 20);
contentPane.add(textField_4);
textFieldName = new JTextField();
textFieldName.setColumns(10);
textFieldName.setBounds(206, 186, 248, 20);
contentPane.add(textFieldName);
JRadioButton rdbtnTypeD =new JRadioButton("Male");
rdbtnTypeD.setBackground(Color.WHITE);
   rdbtnTypeD.setBounds(206, 286, 86, 23);
   JRadioButton rdbtnTypeC = new JRadioButton("Female");
   rdbtnTypeC.setBackground(Color.WHITE);
   rdbtnTypeC.setBounds(303, 286, 105, 23);

   // for group the radio button
        ButtonGroup group = new ButtonGroup();
        group.add(rdbtnTypeD);
        group.add(rdbtnTypeC);
    // to add the radio button in pane
        getContentPane().add(rdbtnTypeD);
        getContentPane().add(rdbtnTypeC);
        
        JLabel lblMatriculation = new JLabel("Academic Record");
        lblMatriculation.setFont(new Font("Tahoma", Font.PLAIN, 13));
        lblMatriculation.setBounds(42, 422, 114, 23);
        contentPane.add(lblMatriculation);
        
        JLabel lblMatriculation_1 = new JLabel("Matriculation");
        lblMatriculation_1.setFont(new Font("Tahoma", Font.PLAIN, 13));
        lblMatriculation_1.setBounds(93, 471, 114, 23);
        contentPane.add(lblMatriculation_1);
        
        JLabel lblIntermediate = new JLabel("Intermediate");
        lblIntermediate.setFont(new Font("Tahoma", Font.PLAIN, 13));
        lblIntermediate.setBounds(93, 505, 114, 23);
        contentPane.add(lblIntermediate);
        
        JLabel lblGraduation = new JLabel("Graduation");
        lblGraduation.setFont(new Font("Tahoma", Font.PLAIN, 13));
        lblGraduation.setBounds(93, 539, 114, 23);
        contentPane.add(lblGraduation);
        
        txtRollNo = new JTextField();
        txtRollNo.setForeground(Color.LIGHT_GRAY);
        txtRollNo.setText("Roll No");
        txtRollNo.setColumns(10);
        txtRollNo.setBounds(194, 473, 73, 20);
        contentPane.add(txtRollNo);
        
        txtMarks = new JTextField();
        txtMarks.setForeground(Color.LIGHT_GRAY);
        txtMarks.setText("Marks");
        txtMarks.setColumns(10);
        txtMarks.setBounds(283, 473, 73, 20);
        contentPane.add(txtMarks);
        
        txtBoard = new JTextField();
        txtBoard.setForeground(Color.LIGHT_GRAY);
        txtBoard.setText("Board");
        txtBoard.setColumns(10);
        txtBoard.setBounds(366, 473, 73, 20);
        contentPane.add(txtBoard);
        
        txtYear = new JTextField();
        txtYear.setForeground(Color.LIGHT_GRAY);
        txtYear.setText("Year");
        txtYear.setColumns(10);
        txtYear.setBounds(449, 473, 73, 20);
        contentPane.add(txtYear);
        
        textField_2 = new JTextField();
        textField_2.setText("Roll No");
        textField_2.setForeground(Color.LIGHT_GRAY);
        textField_2.setColumns(10);
        textField_2.setBounds(194, 505, 73, 20);
        contentPane.add(textField_2);
        
        textField_6 = new JTextField();
        textField_6.setText("Marks");
        textField_6.setForeground(Color.LIGHT_GRAY);
        textField_6.setColumns(10);
        textField_6.setBounds(283, 505, 73, 20);
        contentPane.add(textField_6);
        
        textField_7 = new JTextField();
        textField_7.setText("Board");
        textField_7.setForeground(Color.LIGHT_GRAY);
        textField_7.setColumns(10);
        textField_7.setBounds(366, 505, 73, 20);
        contentPane.add(textField_7);
        
        textField_8 = new JTextField();
        textField_8.setText("Year");
        textField_8.setForeground(Color.LIGHT_GRAY);
        textField_8.setColumns(10);
        textField_8.setBounds(449, 505, 73, 20);
        contentPane.add(textField_8);
        
        textField_9 = new JTextField();
        textField_9.setText("Roll No");
        textField_9.setForeground(Color.LIGHT_GRAY);
        textField_9.setColumns(10);
        textField_9.setBounds(194, 539, 73, 20);
        contentPane.add(textField_9);
        
        textField_10 = new JTextField();
        textField_10.setText("Marks");
        textField_10.setForeground(Color.LIGHT_GRAY);
        textField_10.setColumns(10);
        textField_10.setBounds(283, 539, 73, 20);
        contentPane.add(textField_10);
        
        textField_11 = new JTextField();
        textField_11.setText("Board");
        textField_11.setForeground(Color.LIGHT_GRAY);
        textField_11.setColumns(10);
        textField_11.setBounds(366, 539, 73, 20);
        contentPane.add(textField_11);
        
        textField_12 = new JTextField();
        textField_12.setText("Year");
        textField_12.setForeground(Color.LIGHT_GRAY);
        textField_12.setColumns(10);
        textField_12.setBounds(449, 539, 73, 20);
        contentPane.add(textField_12);
        
        JButton btnNewButton = new JButton("Submit Me");
        btnNewButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
       
        JOptionPane.showMessageDialog(null,textFieldName.getText()+" your registration is submitted in "+comboBox.getSelectedItem());
       
        }
        });
        btnNewButton.setBounds(223, 602, 133, 30);
        contentPane.add(btnNewButton);
        
        JPanel panel = new JPanel();
        panel.setBackground(Color.WHITE);
        panel.setBounds(0, 167, 562, 410);
        contentPane.add(panel);
        
        JButton btnNewButton_1 = new JButton("Back");
        btnNewButton_1.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
       
        MainInter m = new MainInter();
        m.setVisible(true);
        dispose();
        }
        });
        btnNewButton_1.setBounds(0, 657, 63, 23);
        contentPane.add(btnNewButton_1);
    
}
}


Class No.9

import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Font;
import java.awt.Color;
import java.awt.Toolkit;

public class ExamsForStd extends JFrame {

private JPanel contentPane;

public ExamsForStd() {
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setTitle("Exam Calander");
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 455, 351);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("Exam Calander");
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 25));
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setBounds(72, 37, 278, 27);
contentPane.add(lblNewLabel);
JLabel lblMidTermExam = new JLabel("Mid Term Exam Date: ");
lblMidTermExam.setFont(new Font("Tahoma", Font.BOLD, 13));
lblMidTermExam.setBounds(60, 144, 153, 21);
contentPane.add(lblMidTermExam);
JLabel label = new JLabel("15-12-2-15");
label.setBounds(241, 147, 143, 21);
contentPane.add(label);
JLabel lblFinalExamDate = new JLabel("Final Exam Date: ");
lblFinalExamDate.setFont(new Font("Tahoma", Font.BOLD, 13));
lblFinalExamDate.setBounds(60, 208, 153, 21);
contentPane.add(lblFinalExamDate);
JLabel lblUpdatedSoon = new JLabel("Updated Soon");
lblUpdatedSoon.setBounds(241, 208, 143, 21);
contentPane.add(lblUpdatedSoon);
JLabel lblExaCName = new JLabel("Name");
lblExaCName.setHorizontalAlignment(SwingConstants.CENTER);
lblExaCName.setBounds(129, 75, 153, 36);
contentPane.add(lblExaCName);
JPanel panel = new JPanel();
panel.setBackground(Color.LIGHT_GRAY);
panel.setBounds(57, 122, 341, 131);
contentPane.add(panel);
}
}


Class No.10

import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import javax.swing.SwingConstants;
import javax.swing.ImageIcon;
import java.awt.Toolkit;

public class Exam extends JFrame {

private JPanel contentPane;
private JTextField tfName;
private JTextField tfRollNumber;
private JTextField tfGPA;
private JButton btnGetPercentage;
private JLabel lblStudentResult;
private JLabel lblNewLabel_1;
private JPanel panel;
private JButton btnNewButton;


public Exam() {
setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\Ali\\Desktop\\pic for project\\HU_logo_jpeg_400x400.png"));
setTitle("Get result");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 538);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("Name");
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
lblNewLabel.setBounds(46, 157, 62, 20);
contentPane.add(lblNewLabel);
JLabel lblRollNumber = new JLabel("Roll Number");
lblRollNumber.setFont(new Font("Tahoma", Font.PLAIN, 15));
lblRollNumber.setBounds(46, 220, 97, 20);
contentPane.add(lblRollNumber);
JLabel lblGpa = new JLabel("GPA");
lblGpa.setFont(new Font("Tahoma", Font.PLAIN, 15));
lblGpa.setBounds(46, 278, 62, 20);
contentPane.add(lblGpa);
tfName = new JTextField();
tfName.setBounds(150, 159, 182, 20);
contentPane.add(tfName);
tfName.setColumns(10);
tfRollNumber = new JTextField();
tfRollNumber.setColumns(10);
tfRollNumber.setBounds(150, 222, 182, 20);
contentPane.add(tfRollNumber);
tfGPA = new JTextField();
tfGPA.setColumns(10);
tfGPA.setBounds(150, 280, 182, 20);
contentPane.add(tfGPA);
JButton btnGetGPA = new JButton("Get GPA");
btnGetGPA.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

tfGPA.setText("3.7");
}
});
btnGetGPA.setBounds(80, 380, 131, 23);
contentPane.add(btnGetGPA);
btnGetPercentage = new JButton("Get Percentage");
btnGetPercentage.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

float gpa = Float.parseFloat(tfGPA.getText());
double perGpa =gpa/4.0*100;
JOptionPane.showMessageDialog(null, "Your GPA in percentage is: "+perGpa);
}
});
btnGetPercentage.setBounds(247, 380, 131, 23);
contentPane.add(btnGetPercentage);
lblStudentResult = new JLabel("Student Result");
lblStudentResult.setHorizontalAlignment(SwingConstants.CENTER);
lblStudentResult.setFont(new Font("Tahoma", Font.PLAIN, 23));
lblStudentResult.setForeground(Color.DARK_GRAY);
lblStudentResult.setBounds(114, 52, 207, 20);
contentPane.add(lblStudentResult);
lblNewLabel_1 = new JLabel("");
lblNewLabel_1.setIcon(new ImageIcon("C:\\Users\\Ali\\Desktop\\pic for project\\small.png"));
lblNewLabel_1.setBounds(10, 11, 109, 103);
contentPane.add(lblNewLabel_1);
panel = new JPanel();
panel.setBackground(Color.WHITE);
panel.setBounds(-15, 125, 463, 210);
contentPane.add(panel);
btnNewButton = new JButton("back");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
MainInter m = new MainInter();
        m.setVisible(true);
        dispose();
}
});
btnNewButton.setBounds(0, 476, 62, 23);
contentPane.add(btnNewButton);
}
}

Comments

Popular posts from this blog

Umbrella activities in Software Engineering

Operating System | Best Definition of Opetating System