import
import
import
import
import
import
import
import
import
import
import
import
import

java.awt.BorderLayout;
java.aw...
private
private
private
private
private
private
private
private
private
private
private
private

openAcademic oa;
openVers...
exit.addActionListener(new exitApp());
// Attach submenu to menu
menu.add(academicPerformance);
menu.add(appVersion);
menu...
Eng0L.setText("Eng 0 : ");
Eng0L.setForeground(Color.BLACK);
Eng0L.setBounds(350, 100, 100, 20);
Eng0L.setFont(new Font("C...
CS132LabL = new JLabel();
CS132LabL.setText("CS132L: ");
CS132LabL.setForeground(Color.BLACK);
CS132LabL.setBounds(350, 10...
forecastB.setBorderPainted(true);
forecastB.setContentAreaFilled(true);
forecastB.setFocusPainted(true);
forecastB.setOpaq...
content.add(CS132LabL);
content.add(POLSCI2L);
content.add(PE1L);
content.add(NSTP1L);
content.add(clearB);
content.add(fo...
.showMessageDialog(
null,
"used to clear the input grades in the
field of first year first semesternnNOTE: used to enable ...
private class openVersion implements ActionListener {
public void actionPerformed(ActionEvent ae) {
statusBar.setText("Bui...
}

+ time);

}
}
// Clear TextField from 1st year 1st semester
private class ClearButtonHandler implements ActionListener ...
String cs132 =
String.valueOf(gradeChoiceList8.getSelectedItem());
String cs132L =
String.valueOf(gradeChoiceList9.getSele...
}
_____________________________

import
import
import
import
import
import
import
import
import
import
import
import
impor...
bh = new backHome();
goBack.addActionListener(bh);
menu.add(goBack);
visitTed = new Menu("Teddy Eddie Q. Dispo Jr.");
vT =...
aboutTA.setForeground(Color.BLACK);
aboutTA.setEditable(false);
aboutTA.setBackground(Color.WHITE);
JScrollPane scroll = n...
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
statusBar
.setText("RexTeddy, 2013-201...
}

}

_______________________
import java.awt.Color;
import com.thehowtotutorial.splashscreen.JSplash;
public class Main {...
Upcoming SlideShare
Loading in …5
×

Revision c odesagain

580 views
486 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
580
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Revision c odesagain

  1. 1. import import import import import import import import import import import import import java.awt.BorderLayout; java.awt.Color; java.awt.Font; java.awt.Menu; java.awt.MenuBar; java.awt.MenuItem; java.awt.Toolkit; java.awt.event.ActionEvent; java.awt.event.ActionListener; java.io.IOException; java.text.DateFormat; java.text.SimpleDateFormat; java.util.Date; import import import import import import import import import import import import import javax.swing.BorderFactory; javax.swing.ImageIcon; javax.swing.JButton; javax.swing.JComboBox; javax.swing.JFrame; javax.swing.JLabel; javax.swing.JOptionPane; javax.swing.JPanel; javax.swing.JScrollPane; javax.swing.JTextArea; javax.swing.border.BevelBorder; javax.swing.border.EtchedBorder; javax.swing.border.LineBorder; public class AcademicPerformance extends JFrame { private static final int WIDTH = 600; private static final int HEIGHT = 600; String URL = "http://www.anderson.ucla.edu/faculty/jason.frand/teacher/technologies/palace/da tamining.htm"; String URL2 = "http://en.wikipedia.org/wiki/Forecasting"; // ComboBox String[] gradeChoicesItem = { "Select Grade:", "1.00", "1.25", "1.50", "1.75", "2.00", "2.25", "2.50", "2.75", "3.00", "5.00", "7.00" }; double[] gradeChoiceEquivalent = { 0.00, 1.00, 1.25, 1.50, 1.75, 2.00, 2.25, 2.50, 2.75, 3.00, 5.00, 7.00 }; private JComboBox gradeChoiceList, gradeChoiceList2, gradeChoiceList3, gradeChoiceList4, gradeChoiceList5, gradeChoiceList6, gradeChoiceList7, gradeChoiceList8, gradeChoiceList9, gradeChoiceList10, gradeChoiceList11, gradeChoiceList12; // Date and Time final JLabel timeLabel = new JLabel(); final DateFormat timeFormat = new SimpleDateFormat( "E MM-dd-yyyy 'at' hh:mm a"); Date date = new Date(); String time = timeFormat.format(date); // Menubar and MenuItem MenuBar mbar; Menu menu, academicPerformance, appVersion, help, clearMenu, forecastMenu, textMenu, aboutForecasting; MenuItem devTeam, exit, aP, aV, cM, fM, tM, aF; private openDevTeam odt;
  2. 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. 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();
  4. 4. Eng0L.setText("Eng 0 : "); Eng0L.setForeground(Color.BLACK); Eng0L.setBounds(350, 100, 100, 20); Eng0L.setFont(new Font("Calibri", Font.PLAIN, 14)); Eng0L.setLocation(30, 150); gradeChoiceList3 = new JComboBox(gradeChoicesItem); gradeChoiceList3.setSelectedIndex(0); gradeChoiceList3.setBounds(480, 120, 170, 25); gradeChoiceList3.setLocation(85, 150); Eng1L = new JLabel(); Eng1L.setText("Eng 1 : "); Eng1L.setForeground(Color.BLACK); Eng1L.setFont(new Font("Calibri", Font.PLAIN, 14)); Eng1L.setBounds(350, 100, 100, 20); Eng1L.setLocation(30, 180); gradeChoiceList4 = new JComboBox(gradeChoicesItem); gradeChoiceList4.setSelectedIndex(0); gradeChoiceList4.setBounds(480, 120, 170, 25); gradeChoiceList4.setLocation(85, 180); Fil1L = new JLabel(); Fil1L.setText("Fil 1 : "); Fil1L.setForeground(Color.BLACK); Fil1L.setBounds(350, 100, 100, 20); Fil1L.setFont(new Font("Calibri", Font.PLAIN, 14)); Fil1L.setLocation(30, 210); gradeChoiceList5 = new JComboBox(gradeChoicesItem); gradeChoiceList5.setSelectedIndex(0); gradeChoiceList5.setBounds(480, 120, 170, 25); gradeChoiceList5.setLocation(85, 210); CS131L = new JLabel(); CS131L.setText("CS131 : "); CS131L.setForeground(Color.BLACK); CS131L.setBounds(350, 100, 100, 20); CS131L.setFont(new Font("Calibri", Font.PLAIN, 14)); CS131L.setLocation(25, 240); gradeChoiceList6 = new JComboBox(gradeChoicesItem); gradeChoiceList6.setSelectedIndex(0); gradeChoiceList6.setBounds(480, 120, 170, 25); gradeChoiceList6.setLocation(85, 240); CS131LabL = new JLabel(); CS131LabL.setText("CS131L: "); CS131LabL.setForeground(Color.BLACK); CS131LabL.setBounds(350, 100, 100, 20); CS131LabL.setFont(new Font("Calibri", Font.PLAIN, 14)); CS131LabL.setLocation(25, 270); gradeChoiceList7 = new JComboBox(gradeChoicesItem); gradeChoiceList7.setSelectedIndex(0); gradeChoiceList7.setBounds(480, 120, 170, 25); gradeChoiceList7.setLocation(85, 270); CS132L = new JLabel(); CS132L.setText("CS132 : "); CS132L.setForeground(Color.BLACK); CS132L.setBounds(350, 100, 100, 20); CS132L.setFont(new Font("Calibri", Font.PLAIN, 14)); CS132L.setLocation(25, 300); gradeChoiceList8 = new JComboBox(gradeChoicesItem); gradeChoiceList8.setSelectedIndex(0); gradeChoiceList8.setBounds(480, 120, 170, 25); gradeChoiceList8.setLocation(85, 300);
  5. 5. CS132LabL = new JLabel(); CS132LabL.setText("CS132L: "); CS132LabL.setForeground(Color.BLACK); CS132LabL.setBounds(350, 100, 100, 20); CS132LabL.setFont(new Font("Calibri", Font.PLAIN, 14)); CS132LabL.setLocation(25, 330); gradeChoiceList9 = new JComboBox(gradeChoicesItem); gradeChoiceList9.setSelectedIndex(0); gradeChoiceList9.setBounds(480, 120, 170, 25); gradeChoiceList9.setLocation(85, 330); POLSCI2L = new JLabel(); POLSCI2L.setText("POL SCI 2: "); POLSCI2L.setForeground(Color.BLACK); POLSCI2L.setFont(new Font("Calibri", Font.PLAIN, 14)); POLSCI2L.setBounds(350, 100, 100, 20); POLSCI2L.setLocation(15, 360); gradeChoiceList10 = new JComboBox(gradeChoicesItem); gradeChoiceList10.setSelectedIndex(0); gradeChoiceList10.setBounds(480, 120, 170, 25); gradeChoiceList10.setLocation(85, 360); PE1L = new JLabel(); PE1L.setText("PE 1 : "); PE1L.setForeground(Color.BLACK); PE1L.setBounds(350, 100, 100, 20); PE1L.setFont(new Font("Calibri", Font.PLAIN, 14)); PE1L.setLocation(35, 390); gradeChoiceList11 = new JComboBox(gradeChoicesItem); gradeChoiceList11.setSelectedIndex(0); gradeChoiceList11.setBounds(480, 120, 170, 25); gradeChoiceList11.setLocation(85, 390); NSTP1L = new JLabel(); NSTP1L.setText("NSTP 1 : "); NSTP1L.setForeground(Color.BLACK); NSTP1L.setBounds(350, 100, 100, 20); NSTP1L.setFont(new Font("Calibri", Font.PLAIN, 14)); NSTP1L.setLocation(25, 420); gradeChoiceList12 = new JComboBox(gradeChoicesItem); gradeChoiceList12.setSelectedIndex(0); gradeChoiceList12.setBounds(480, 120, 170, 25); gradeChoiceList12.setLocation(85, 420); clearB = new JButton(""); cbHandler = new ClearButtonHandler(); clearB.addActionListener(cbHandler); clearB.setBounds(130, 130, 103, 25); clearB.setLocation(45, 455); clearB.setIcon(new ImageIcon(getClass().getResource("clearB2.png"))); clearB.setBorderPainted(true); clearB.setContentAreaFilled(true); clearB.setFocusPainted(true); clearB.setOpaque(true); forecastB = new JButton(""); fbHandler = new ForecastButtonHandler(); forecastB.addActionListener(fbHandler); forecastB.setBounds(130, 130, 103, 25); forecastB.setLocation(170, 455); forecastB.setIcon(new ImageIcon(getClass() .getResource("forecast2a.png")));
  6. 6. forecastB.setBorderPainted(true); forecastB.setContentAreaFilled(true); forecastB.setFocusPainted(true); forecastB.setOpaque(true); lineTA = new JTextArea(""); lineTA.setEditable(false); lineTA.setBounds(400, 140, 1, 435); lineTA.setLocation(285, 41); lineTA.setBackground(Color.DARK_GRAY); statusBar = new JLabel( "RexTeddy, 2013-2014, All rights reserved " + time); statusBar.setBorder(BorderFactory .createEtchedBorder(EtchedBorder.RAISED)); forecastOutputTA = new JTextArea( "____________________________n Welcomen ton " + "Forecasting Systemn of BSCS studentsn " + "inn New Era Univeristyn 2014n____________________________n " + "Researchers:n Dispon " + "TuganonnnAcademic Performance ©2014n____________________________"); forecastOutputTA.setFont(new Font("Calibri", Font.PLAIN, 20)); forecastOutputTA.setForeground(Color.BLACK); forecastOutputTA.setEditable(false); forecastOutputTA.setSelectedTextColor(Color.BLUE); forecastOutputTA.setBackground(Color.WHITE); JScrollPane scroll = new JScrollPane(forecastOutputTA); 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, 267); scroll.setLocation(300, 185); outputB = new JButton(""); outputB.setBounds(600, 700, 290, 200); outputB.setLocation(295, 10); outputB.setIcon(new ImageIcon(getClass().getResource("outp.png"))); outputB.setBorderPainted(false); outputB.setContentAreaFilled(false); outputB.setFocusPainted(false); outputB.setOpaque(false); content.setLayout(null); content.add(b2); content.add(Mat171L); content.add(b1); content.add(firstYear1stSem); content.add(Mat172L); content.add(Eng0L); content.add(Eng1L); content.add(Fil1L); content.add(CS131L); content.add(CS131LabL); content.add(CS132L);
  7. 7. content.add(CS132LabL); content.add(POLSCI2L); content.add(PE1L); content.add(NSTP1L); content.add(clearB); content.add(forecastB); content.add(lineTA); content.add(timeLabel); content.add(outputB); content.add(gradeChoiceList); content.add(gradeChoiceList2); content.add(gradeChoiceList3); content.add(gradeChoiceList4); content.add(gradeChoiceList5); content.add(gradeChoiceList6); content.add(gradeChoiceList7); content.add(gradeChoiceList8); content.add(gradeChoiceList9); content.add(gradeChoiceList10); content.add(gradeChoiceList11); content.add(gradeChoiceList12); content.add(scroll); add(statusBar, BorderLayout.SOUTH); add(content); // setContentPane(content); pack(); setIconImage(Toolkit.getDefaultToolkit().getImage("srclogo2.png")); setSize(WIDTH, HEIGHT); content.setBackground(Color.LIGHT_GRAY); setLocationRelativeTo(null); // Center the frame setResizable(false); setDefaultCloseOperation(EXIT_ON_CLOSE); } // Exit app static class exitApp implements ActionListener { public void actionPerformed(ActionEvent e) { statusBar.setText("Exit Application"); JOptionPane.showMessageDialog(null, " Thank you", "tExit Academic Performance 2014", JOptionPane.PLAIN_MESSAGE); System.exit(0); } } // Open Developer and Researchers from menu private class openDevTeam implements ActionListener { public void actionPerformed(ActionEvent ae) { statusBar.setText("Developers and Researchers"); DeveloperAndResearchers devteam = new DeveloperAndResearchers(); devteam.setVisible(true); dispose(); } } // Open help clear private class openClear implements ActionListener { public void actionPerformed(ActionEvent ae) { statusBar.setText("Clear button function"); JOptionPane
  8. 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. 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 "
  10. 10. } + time); } } // Clear TextField from 1st year 1st semester private class ClearButtonHandler implements ActionListener { public void actionPerformed(ActionEvent ae) { statusBar.setText("Clicked button Clear"); forecastOutputTA .setText("__________________________n Welcomen ton " + "Forecasting Systemn of BSCS studentsn " + "inn New Era Univeristyn 2014n__________________________n " + "Researchers:n Dispon " + "Tuganonnn Academic Performance © 2014n__________________________"); JOptionPane.showMessageDialog(null, " Clear the fields", "Clear", JOptionPane.PLAIN_MESSAGE); gradeChoiceList.setSelectedIndex(0); gradeChoiceList2.setSelectedIndex(0); gradeChoiceList3.setSelectedIndex(0); gradeChoiceList4.setSelectedIndex(0); gradeChoiceList5.setSelectedIndex(0); gradeChoiceList6.setSelectedIndex(0); gradeChoiceList7.setSelectedIndex(0); gradeChoiceList8.setSelectedIndex(0); gradeChoiceList9.setSelectedIndex(0); gradeChoiceList10.setSelectedIndex(0); gradeChoiceList11.setSelectedIndex(0); gradeChoiceList12.setSelectedIndex(0); forecastB.setEnabled(true); statusBar .setText("RexTeddy, 2013-2014, All rights reserved " + time); } } // Forecasting button for 1st semester that forecast the students will // continue to 4th year private class ForecastButtonHandler implements ActionListener { public void actionPerformed(ActionEvent ae) { statusBar.setText("Clicked button Forecast"); String mat171 = String.valueOf(gradeChoiceList.getSelectedItem()); String mat172 = String.valueOf(gradeChoiceList2.getSelectedItem()); String eng0 = String.valueOf(gradeChoiceList3.getSelectedItem()); String eng1 = String.valueOf(gradeChoiceList4.getSelectedItem()); String fil1 = String.valueOf(gradeChoiceList5.getSelectedItem()); String cs131 = String.valueOf(gradeChoiceList6.getSelectedItem()); String cs131L = String.valueOf(gradeChoiceList7.getSelectedItem());
  11. 11. String cs132 = String.valueOf(gradeChoiceList8.getSelectedItem()); String cs132L = String.valueOf(gradeChoiceList9.getSelectedItem()); String polsci = String.valueOf(gradeChoiceList10.getSelectedItem()); String pe1 = String.valueOf(gradeChoiceList11.getSelectedItem()); String nstp1 = String.valueOf(gradeChoiceList12.getSelectedItem()); try { double m171 = Double.parseDouble((String) gradeChoiceList .getSelectedItem()); double m172 = Double.parseDouble((String) gradeChoiceList2 .getSelectedItem()); double e0 = Double.parseDouble((String) gradeChoiceList3 .getSelectedItem()); // Formula and Computations Place here double i = m171 + m172; // Loading kuno LoadingOutput load = new LoadingOutput(); load.setVisible(true); statusBar.setText("Results"); JOptionPane.showMessageDialog(null, " Show results!", "Results", JOptionPane.PLAIN_MESSAGE); load.dispose(); // Output forecastOutputTA.setText("Mat171: "Mat172: " + m172 + "n" + "Eng0: forecastB.setEnabled(false); " + i + "n" + " + e0); } catch (NumberFormatException nfe) { statusBar.setText("ERROR"); JOptionPane.showMessageDialog(null, "Please input grades provided in the field", "ERROR", statusBar JOptionPane.ERROR_MESSAGE); .setText("RexTeddy, 2013-2014, " + time); } catch (Exception ex) { statusBar.setText("ERROR"); JOptionPane.showMessageDialog(null, "Please input grades provided in the field", All rights reserved "ERROR", statusBar All rights reserved } } } JOptionPane.ERROR_MESSAGE); .setText("RexTeddy, 2013-2014, " + time);
  12. 12. } _____________________________ import import import import import import import import import import import import import java.awt.BorderLayout; java.awt.Color; java.awt.Font; java.awt.Menu; java.awt.MenuBar; java.awt.MenuItem; java.awt.Toolkit; java.awt.event.ActionEvent; java.awt.event.ActionListener; java.io.IOException; java.text.DateFormat; java.text.SimpleDateFormat; java.util.Date; import import import import import import import import import import javax.swing.BorderFactory; javax.swing.ImageIcon; javax.swing.JButton; javax.swing.JFrame; javax.swing.JLabel; javax.swing.JPanel; javax.swing.JScrollPane; javax.swing.JTextArea; javax.swing.border.EtchedBorder; javax.swing.border.LineBorder; public class DeveloperAndResearchers extends JFrame { private static final int WIDTH = 580; private static final int HEIGHT = 320; String URL1 = "https://www.facebook.com/eniaryddet?fref=ts"; String URL2 = "https://www.facebook.com/rexiel.tugano?fref=ts"; final JLabel timeLabel = new JLabel(); final DateFormat timeFormat = new SimpleDateFormat( "E MM-dd-yyyy 'at' hh:mm a"); Date date = new Date(); String time = timeFormat.format(date); MenuBar mbar; Menu menu, back, visitTed,visitRex, visit; MenuItem goBack,vT,vR; private backHome bh; private openVisitTed ovt; private openVisitRex ovr; private JButton logoB; private JTextArea aboutTA; private JLabel statusBar; public DeveloperAndResearchers() { setTitle("About Developers and Researchers"); JPanel content = new JPanel(); // Create the menu bar mbar = new MenuBar(); // Create the menu menu = new Menu("Back"); visit = new Menu("Visit Us"); goBack = new MenuItem("Go back in Homescreen");
  13. 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. 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. 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);
  16. 16. } } _______________________ import java.awt.Color; import com.thehowtotutorial.splashscreen.JSplash; public class Main { public static void main(String[] args) { try { JSplash splash = new JSplash( Main.class.getResource("academic3.png"), true, true, false, "Beta Version 1.0.0", null, Color.RED, Color.DARK_GRAY); splash.splashOn(); // Call Method splash.setProgress(8, "Initializing...."); //Thread.sleep(1300); Thread.sleep(100); splash.setProgress(24, "Loading....."); //Thread.sleep(2000); Thread.sleep(100); splash.setProgress(39, "Please wait......"); //Thread.sleep(1600); Thread.sleep(100); splash.setProgress(51, "Applying Configs......."); //Thread.sleep(1200); Thread.sleep(100); splash.setProgress(68, "Forecasting..........."); //Thread.sleep(1000); Thread.sleep(100); splash.setProgress(81, "Starting App........"); //Thread.sleep(900); Thread.sleep(100); splash.setProgress(99, "Welcome to Academic Performance 2014......"); //Thread.sleep(500); Thread.sleep(100); splash.splashOff(); splash.dispose(); AcademicPerformance forecastingStudent = new AcademicPerformance(); forecastingStudent.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }

×