2. private
private
private
private
private
private
private
private
private
private
private
private
openAcademic oa;
openVersion ov;
openClear oc;
openForecast of;
openText ot;
openKnowledgeForecasting okf;
JLabel firstYear1stSem, Mat171L, Mat172L, Eng0L, Eng1L, Fil1L,
CS131L, CS131LabL, CS132L, CS132LabL, POLSCI2L, PE1L, NSTP1L;
static JLabel statusBar;
JButton b1, b2, clearB, forecastB, outputB;
ClearButtonHandler cbHandler;
ForecastButtonHandler fbHandler;
JTextArea lineTA, forecastOutputTA;
public AcademicPerformance() {
setTitle("Academic Performance");
JPanel content = new JPanel();
// Create the menu bar
mbar = new MenuBar();
// Create the menu
menu = new Menu("About Us");
help = new Menu("Help");
// Create the submenu
academicPerformance = new Menu("Academic Peformance");
appVersion = new Menu("Application Version");
aP = new MenuItem(
"A system that Forecast students Academic Peformance of
BSCS students in New Era University");
oa = new openAcademic();
aP.addActionListener(oa);
aV = new MenuItem("Beta Version 1.0.0");
ov = new openVersion();
aV.addActionListener(ov);
clearMenu = new Menu("Clear button");
cM = new MenuItem("clears input in the fields.");
oc = new openClear();
cM.addActionListener(oc);
forecastMenu = new Menu("Forecast button");
fM = new MenuItem("forecast student probability to graduate.");
of = new openForecast();
fM.addActionListener(of);
textMenu = new Menu("ComboBox / Field");
tM = new MenuItem("choose input grades of the student.");
ot = new openText();
tM.addActionListener(ot);
aboutForecasting = new Menu("Help, About Data Mining and
Forecasting");
aF = new MenuItem("What is Data Mining and Forecasting");
okf = new openKnowledgeForecasting();
aF.addActionListener(okf);
// Attach menu items to submenu
academicPerformance.add(aP);
appVersion.add(aV);
clearMenu.add(cM);
forecastMenu.add(fM);
textMenu.add(tM);
aboutForecasting.add(aF);
// Attach menu items to menu
devTeam = new MenuItem("Developers and Researchers");
odt = new openDevTeam();
devTeam.addActionListener(odt);
exit = new MenuItem("Exit Application");
3. exit.addActionListener(new exitApp());
// Attach submenu to menu
menu.add(academicPerformance);
menu.add(appVersion);
menu.add(devTeam);
menu.add(exit);
help.add(clearMenu);
help.add(forecastMenu);
help.add(textMenu);
help.add(aboutForecasting);
// Attach menu to menu bar
mbar.add(menu);
mbar.add(help);
// Set menu bar to the frame
setMenuBar(mbar);
b2 = new JButton("");
b2.setBounds(600, 700, 600, 32);
b2.setLocation(0, 0);
b2.setIcon(new ImageIcon(getClass().getResource("newFor.png")));
b2.setBorderPainted(false);
b2.setContentAreaFilled(false);
b2.setFocusPainted(false);
b2.setOpaque(false);
Mat171L = new JLabel();
Mat171L.setText("Mat171: ");
Mat171L.setForeground(Color.BLACK);
Mat171L.setFont(new Font("Calibri", Font.PLAIN, 14));
Mat171L.setBounds(350, 100, 100, 20);
Mat171L.setLocation(25, 90);
gradeChoiceList = new JComboBox(gradeChoicesItem);
gradeChoiceList.setBounds(480, 120, 170, 25);
gradeChoiceList.setLocation(85, 90);
gradeChoiceList.setSelectedIndex(0);
b1 = new JButton("");
b1.setBounds(600, 700, 600, 30);
b1.setLocation(0, 503);
b1.setIcon(new ImageIcon(getClass().getResource("newAca.png")));
b1.setBorderPainted(false);
b1.setContentAreaFilled(false);
b1.setFocusPainted(false);
b1.setOpaque(false);
firstYear1stSem = new JLabel();
firstYear1stSem.setText("First Year 1st Semester");
firstYear1stSem.setForeground(Color.BLACK);
firstYear1stSem.setFont(new Font("Calibri", Font.BOLD, 18));
firstYear1stSem.setBounds(350, 100, 170, 20);
firstYear1stSem.setLocation(70, 55);
Mat172L = new JLabel();
Mat172L.setText("Mat172: ");
Mat172L.setForeground(Color.BLACK);
Mat172L.setFont(new Font("Calibri", Font.PLAIN, 14));
Mat172L.setBounds(350, 100, 100, 20);
Mat172L.setLocation(25, 120);
gradeChoiceList2 = new JComboBox(gradeChoicesItem);
gradeChoiceList2.setSelectedIndex(0);
gradeChoiceList2.setBounds(480, 120, 170, 25);
gradeChoiceList2.setLocation(85, 120);
Eng0L = new JLabel();
8. .showMessageDialog(
null,
"used to clear the input grades in the
field of first year first semesternnNOTE: used to enable Forecast button.",
"tClear button function",
JOptionPane.INFORMATION_MESSAGE);
statusBar
.setText("RexTeddy, 2013-2014,
All rights reserved
"
+ time);
}
}
// Open help text field inputs
private class openText implements ActionListener {
public void actionPerformed(ActionEvent ae) {
statusBar.setText("ComboBox / Field function");
JOptionPane
.showMessageDialog(
null,
"used to input grades of student in
the field to Forecast probability to graduaten
- users can choose grades
from:n
1.0, 1.25, 1.75,n
2.0, 2.25, 2.50, 2.75n
3.0, 5.0, 7.0n NOTE: Always input grades in the fields otherwise Forecast
button will not function.",
"tComboBox / Field function",
JOptionPane.INFORMATION_MESSAGE);
statusBar
.setText("RexTeddy, 2013-2014,
All rights reserved
"
+ time);
}
}
// Open Academic Performance saying
private class openAcademic implements ActionListener {
public void actionPerformed(ActionEvent ae) {
statusBar.setText("Greetings");
JOptionPane
.showMessageDialog(
null,
" A Thesis presented to the Faculty of
New Era University, n
Department of Computer Sciencen"
+ "
College of
Engineering and Technologyn
"
+ "New Era, Quezon
Citynnn
In Partial Fulfillment of then"
+ "
Requirements for the Degreen
"
+ "Bachelor of Science in
Computer Science (BSCS)",
"tGreetings",
JOptionPane.PLAIN_MESSAGE);
statusBar
.setText("RexTeddy, 2013-2014,
All rights reserved
"
+ time);
}
}
// Open the version of system
9. private class openVersion implements ActionListener {
public void actionPerformed(ActionEvent ae) {
statusBar.setText("Build Version");
JOptionPane.showMessageDialog(null,
"This version is still on BETA-VERSION 1.0.0",
"tBuild Version", JOptionPane.PLAIN_MESSAGE);
statusBar
.setText("RexTeddy, 2013-2014,
All rights reserved
"
+ time);
}
}
// Open help forecast
private class openForecast implements ActionListener {
public void actionPerformed(ActionEvent ae) {
statusBar.setText("Forecast button function");
JOptionPane
.showMessageDialog(
null,
"used to forecast the grades that
input in the text fields",
"tForecast button function",
JOptionPane.INFORMATION_MESSAGE);
statusBar
.setText("RexTeddy, 2013-2014,
All rights reserved
"
+ time);
}
}
// Open help users to know about datamining and forecasting
private class openKnowledgeForecasting implements ActionListener {
public void actionPerformed(ActionEvent ae) {
statusBar.setText("Help, About Data Mining and
Forecasting");
JLabel browse = new JLabel(URL);
int dialogButton = JOptionPane
.showConfirmDialog(
null,
"Would you like to know about
Data Mining and Forecasting?",
"tHelp, Data Mining and
Forecasting",
JOptionPane.YES_NO_OPTION);
if(dialogButton == JOptionPane.YES_OPTION) {
try {
java.awt.Desktop.getDesktop().browse(java.net.URI.create(URL));
java.awt.Desktop.getDesktop().browse(java.net.URI.create(URL2));
statusBar
.setText("RexTeddy, 2013-2014,
All rights reserved
"
+ time);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(dialogButton == JOptionPane.NO_OPTION) {
statusBar
.setText("RexTeddy, 2013-2014,
All rights reserved
"
13. bh = new backHome();
goBack.addActionListener(bh);
menu.add(goBack);
visitTed = new Menu("Teddy Eddie Q. Dispo Jr.");
vT = new MenuItem("from Facebook");
ovt = new openVisitTed();
vT.addActionListener(ovt);
visitTed.add(vT);
visit.add(visitTed);
visitRex = new Menu("Rexiel Kenneth P. Tugano");
vR = new MenuItem("from Facebook");
ovr = new openVisitRex();
vR.addActionListener(ovr);
visitRex.add(vR);
visit.add(visitRex);
// Attach menu to menu bar
mbar.add(menu);
mbar.add(visit);
// Set menu bar to the frame
setMenuBar(mbar);
logoB = new JButton("");
logoB.setBounds(600, 700, 280, 260);
logoB.setLocation(1, 3);
logoB.setIcon(new ImageIcon(getClass().getResource(
"LogoForecasting.png")));
logoB.setBorderPainted(false);
logoB.setContentAreaFilled(false);
logoB.setFocusPainted(false);
logoB.setOpaque(false);
aboutTA = new JTextArea(
" Academic Performancenn Application Version: BetaVersion 1.0.0nn " +
"Developers and Researchers:n
1. Teddy Eddie Q.
Dispo Jr.n
" +
"Libis Dike 1,Brgy. Balite St., Montalban, Rodriguez
Rizal n
" +
"Mobile: 09162689221n
E-mail:
teqdispojr@gmail.comn
Computer Science Studentn
2. Rexiel
Kenneth P. Tuganon
#4 Manansala Street U.P Diliman, Quezon City n"
+
"
Mobile: 09054010643n
E-mail:
rkennethtugano07@gmail.comn
" +
"Computer Science Studentnn Department Of Computer
Sciencenn " +
"Thesis Title:n
A Forecasting Model for the
Students' Academicn
" +
"Performance of BSCS Studentsn
in
New Era Universitynn " +
"Thesis Adviser: Marc P. Laureta, MSCS nn " +
"School Year: 2013 - 2014nn Credits: n
" +
"Prof. Engr. Joyce Ann Z. Cleofen
Prof. Albert A.
Vinluan, MSIT, MSCSn
" +
"Prof. Laurice Anne A. Iglesian
Prof. Irysh Paulo R.
Tipayn
Prof. Audrey Lyle Diegon
" +
"Prof. Rosanna V. Ibarran
Prof. Jeremias Esperenza n
and all CET Faculty Professorsnn Dedicated to:n
Dispo and Tugano
Family.nn " +
"All Rights Reserved.");
aboutTA.setFont(new Font("Calibri", Font.PLAIN, 16));
aboutTA.setSelectedTextColor(Color.BLUE);
14. aboutTA.setForeground(Color.BLACK);
aboutTA.setEditable(false);
aboutTA.setBackground(Color.WHITE);
JScrollPane scroll = new JScrollPane(aboutTA);
scroll.setViewportBorder(new LineBorder(Color.BLACK));
scroll.setViewportBorder(BorderFactory.createEmptyBorder(5, 5, 5,
5));
scroll.setBorder(BorderFactory
.createEtchedBorder(EtchedBorder.RAISED));
scroll.setBounds(400, 140, 285, 245);
scroll.setLocation(285, 3);
statusBar = new JLabel(
"RexTeddy, 2013-2014,
All rights reserved
"
+ time);
statusBar.setBorder(BorderFactory
.createEtchedBorder(EtchedBorder.RAISED));
content.setLayout(null);
content.add(logoB);
content.add(scroll);
add(statusBar, BorderLayout.SOUTH);
add(content);
//setContentPane(content);
pack();
setIconImage(Toolkit.getDefaultToolkit().getImage("srclogo2.png"));
setSize(WIDTH, HEIGHT);
content.setBackground(Color.WHITE);
setLocationRelativeTo(null); // Center the frame
setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
//back to home screen
private class backHome implements ActionListener {
public void actionPerformed(ActionEvent ae) {
statusBar.setText("Go back in Homescreen ");
AcademicPerformance home = new AcademicPerformance();
home.setVisible(true);
dispose();
}
}
private class openVisitTed implements ActionListener {
public void actionPerformed(ActionEvent ae) {
try {
java.awt.Desktop.getDesktop().browse(java.net.URI.create(URL1));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
statusBar
.setText("RexTeddy, 2013-2014,
All rights reserved
"
+ time);
}
}
private class openVisitRex implements ActionListener {
public void actionPerformed(ActionEvent ae) {
try {
java.awt.Desktop.getDesktop().browse(java.net.URI.create(URL2));
15. } catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
statusBar
.setText("RexTeddy, 2013-2014,
All rights reserved
"
+ time);
}
}
}
_______________________________--
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class LoadingOutput extends JFrame {
private static final int WIDTH = 250;
private static final int HEIGHT = 50;
private JProgressBar jp = new JProgressBar();
Timer t;
int i = 3;
public LoadingOutput() {
setTitle("Please wait.....");
JPanel content = new JPanel();
// Create a progress bar
jp = new JProgressBar();
// Paint the percent complete on progress bar
jp.setStringPainted(true);
// Set a size (optional)
jp.setPreferredSize(new Dimension(300, 10));
// Start at 0
jp.setMinimum(0);
// End at 1000
jp.setMaximum(50);
jp.setLocation(0, 0);
// Create a timer that executes for every 2 millisec
t = new Timer(2, new ActionListener() {
public void actionPerformed(ActionEvent ae) {
if (i == 1)
i = 7;
jp.setValue(i++);
}
});
// Start the timer
t.start();
content.setLayout(null);
add(jp);
setContentPane(jp);
pack();
setSize(WIDTH, HEIGHT);
setIconImage(Toolkit.getDefaultToolkit().getImage("srclogo2.png"));
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLocationRelativeTo(null); // Center the frame
setResizable(false);
setVisible(true);