Beruflich Dokumente
Kultur Dokumente
Abstract
The present project report paper introduces java Desktop Application called Fixed Assets Manager that I have developed for Accounting Department of an organization. This work represents a design and development process of the system using Java Programming Language with NetBeans Platform. The main objective is to design a computerized system for the Accounting Department with the purpose of speeding up the process which might be very slow in paper based system. The system provides general functions that are performed during Accounting activities, such as storing and retrieving information about fixed assets along with updating editing and other activities related to managing assets in an organization.
TABLE OF CONTENTS
1.0 Statement of work ..5 1.1 Proposed System 5 1.2 Scope of the System ... 5 2.0 Components Table.6 3.0 System Analysis......7 3.1 Task Analysis...7 3.2 System Description .....8 4.0 Design Rationale.8 5.0 Usability Evaluation ...10
6.0 Appendix...11 6.1 Screenshots....11 6.2 Setup Guide.......14 6.3 Annotated Source..15
7.0 References.28
Page 2
Page 3
Displaying assets by different methods, such as by category, condition, useful lifetime and its current usage.
The application software will work for the organization`s accounting department and all the activities such as editing, updating, storing, deleting data will be done by users, who are mostly accountants and managers and other users can use the system to obtain information, which means the program can generate reports for managers about fixed assets of their organization.
Page 4
Condition
character
Combo box
Select Condition
character character
25 -
Location of asset -
Search a category
Search category
Apply sorting
Save category
Save category
Fill Form
Save Asset
Page 5
3.2 System Description The main goal of FAM is to speed up fixed assets management process and help accounting managers to do their daily activities efficiently and easily and benefit the organization by reducing costs. These objectives are achieved by developing a desktop application with Graphical User Interface which visualizes objects in graphically meaningful representation which makes it easy to remember and learn. More essentially, it provides functions that are required by the accounting department. Particularly using FAM users can easily record fixed asset information and display assets and categories with different conditions and edit information or delete.
Page 6
Every button directs to the related page when clicked, except Exit button. When user clicks Exit button program stops and window closes. I used standard buttons with standard colors and text. Because it is intended to be used by accounting managers, it is not needed to make it colorful with pictures and so on.
Assets category management page contains components as can be seen from snapshot below: Here I used picture which represents folder or specifically category as is related to content of the page and title of the page is blue which suits to the picture. Other components have standard colors and sizes, namely white background for fields where users enter records and gray for overall background which is generally used for different forms. As for layout, I split it into two, one is for searching and another is for displaying assets and updating its information. This layout is clear for users to see what part is used for specific purpose.
Page 7
In addition, I used message windows in case user makes some mistake while entering data, or performing all other components. For example, the picture below shows one of such message window which will appear when user attempts to delete record from database:
Page 8
performing program tasks. This means I can observe user and get note of how he\she using application efficiently and how easy the application to learn for him\her. While evaluating the program I gave my project to a accounting department manager of one business company called Akfa Lighting, and observed how the user is performing tasks, what parts may be difficult to learn, and so on. After this evaluation I got initial feedback and applied it to my project. In testing I mainly focused on efficiency, effectiveness, learnability of the system as well as user satisfaction. These aspects are evaluated in terms of speed, errors made, user performance and satisfaction as illustrated in table below:
1st time Expected Speed Errors Performance User satisfaction Slow Many Good 70% Given Quick enough Less Good 85%
2nd time Expected Fast Very few Very good 80% Given Faster Almost no Very good 90%
3rd time Expected Fast None Very good 90% Given Very fast None Excellent 95%
As is clear from the evaluation statistics, user performance and usability of the system are improved each time after modifications are implemented. And the user performed tasks better than expected which means the application does not require much training and can be easily learned and used.
6.0 Appendix
6.1 Screenshots
Page 9
Page 10
Page 11
Page 12
6.2 Setup Guide The application is located in folder called MyProject. As mentioned above it requires java runtime environment to be executed and Netbeans Platform to start database server. The user must follow these guidelines to execute application: 1. Open netbeans.exe program from Program files 2. Go to Services section at top-left corner 3. Select Java DB properties by right-click 4. Show path to database location. It is JavaDB folder from main folder of the project 5. Right-click Java DB and start server 6. Right click assets_db and connect 7. Run MyProject.jar by going to dist folder of the project.
Page 13
6.3 Annotated source code private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) { System.exit(0); } private void btn_catActionPerformed(java.awt.event.ActionEvent evt) { internalFrame.setVisible(true); txtf_search_cat.setText(""); } private void clear_category(){ txtf_catID.setText(""); txtf_catName.setText(""); txtf_catDesc.setText(""); txtf_catID.setEnabled(false); txtf_catName.setEnabled(false); txtf_catDesc.setEnabled(false); catTable.clearSelection(); } private void btn_clearActionPerformed(java.awt.event.ActionEvent evt) { clear_category(); } private int getLargestId(String query) throws SQLException { int result=0;
Page 14
Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/assets_db", "jamol", "jamol"); Statement st = null; try { st = con.createStatement(); ResultSet rsmax = st.executeQuery(query); while (rsmax.next()){ if(rsmax.getInt(1)==0){ result = 100; } else{ result = rsmax.getInt(1); } }
} catch (SQLException e ) { JOptionPane.showMessageDialog(null, "SQL Syntax Error"); } finally { if (st != null) { st.close(); } } return result; } private void btn_newActionPerformed(java.awt.event.ActionEvent evt) { int newId;
Page 15
txtf_catID.setEnabled(true); txtf_catName.setEnabled(true); txtf_catDesc.setEnabled(true); txtf_catName.requestFocusInWindow(); try{ newId = getLargestId("SELECT MAX(CATID) FROM APP.ASSETCATEGORY")+1; txtf_catID.setText(""+newId);
} catch (SQLException e ) { JOptionPane.showMessageDialog(null, "SQL Syntax Error"); } } private void getCatToCbox() throws SQLException { cbox_cat.removeAllItems(); Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/assets_db", "jamol", "jamol"); Statement st = null; st = con.createStatement(); String query = "select * from APP.ASSETCATEGORY"; ResultSet rs = st.executeQuery(query); cbox_cat.addItem("Select Category"); while (rs.next()){
Page 16
String catName = rs.getString("CATNAME"); cbox_cat.addItem(catName); } cbox_cat.addItem("New Category"); if (st != null) { st.close(); } } private void getCatsToCbox() throws SQLException { cbox_cats.removeAllItems(); Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/assets_db", "jamol", "jamol"); Statement st = null; st = con.createStatement(); String query = "select * from APP.ASSETCATEGORY"; ResultSet rs = st.executeQuery(query); cbox_cats.addItem("All Categories"); while (rs.next()){ String catName = rs.getString("CATNAME"); cbox_cats.addItem(catName); } if (st != null) { st.close(); } } private void getLifetimesToCbox() throws SQLException { cbox_lifetimes.removeAllItems();
Page 17
Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/assets_db", "jamol", "jamol"); Statement st = null; st = con.createStatement(); String query = "select * from APP.FIXEDASSETS"; ResultSet rs = st.executeQuery(query); String lifecheck = "All"; cbox_lifetimes.addItem(lifecheck); while (rs.next()){ String lifetime = rs.getString("LIFETIME"); if(lifetime.equals(lifecheck)){ }else { cbox_lifetimes.addItem(lifetime); lifecheck=lifetime; } } if (st != null) { st.close(); } } private void ViewTable(String catname) throws SQLException { String query, querycount; if(catname.isEmpty()) { query = "select * from APP.ASSETCATEGORY"; querycount = "select count(*) FROM APP.ASSETCATEGORY";
Page 18
} else { query = "select * from APP.ASSETCATEGORY where CATNAME='"+catname+"'"; querycount = "select count(*) FROM APP.ASSETCATEGORY where
DriverManager.getConnection("jdbc:derby://localhost:1527/assets_db", "jamol", "jamol"); Statement st = null; try { st = con.createStatement(); int count=0; ResultSet rscount = st.executeQuery(querycount); while (rscount.next()){ count = rscount.getInt(1); } DefaultTableModel tableModel = (DefaultTableModel) catTable.getModel(); tableModel.setRowCount(count); catTable.setModel(tableModel); ResultSet rs = st.executeQuery(query); int i = 0; while (rs.next()){ String catID = rs.getString("CATID"); String catName = rs.getString("CATNAME"); String catDesc = rs.getString("CATDESCRIPTION");
Page 19
//calling data into jtable for display catTable.setValueAt(i+1, i, 0); catTable.setValueAt(catID, i, 1); catTable.setValueAt(catName, i, 2); catTable.setValueAt(catDesc, i, 3); i++; } } catch (SQLException e ) { JOptionPane.showMessageDialog(null, "SQL Syntax Error"); } finally { if (st != null) { st.close(); } } } private void btn_saveActionPerformed(java.awt.event.ActionEvent evt) { if ((txtf_catID.getText().equals("")) || (txtf_catName.getText().equals("")) || (txtf_catDesc.getText().equals(""))) { JOptionPane.showMessageDialog(this, "Please Fill in All Fields", "Information Message", WIDTH); } else{ try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); } catch (ClassNotFoundException e){
Page 20
JOptionPane.showMessageDialog(this, "There is a problem in JavaDB embedded driver", "Warning", WIDTH); } try{ Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/assets_db", "jamol", "jamol"); Statement stmt = con.createStatement(); String sqlquery = "select * from APP.ASSETCATEGORY where
CATID="+txtf_catID.getText(); ResultSet rsid = stmt.executeQuery(sqlcheckid); int intid=0; while (rsid.next()){ intid = rsid.getInt("CATID"); } ResultSet rs = stmt.executeQuery(sqlquery); String cName=""; int cId=0; while (rs.next()){ cName = rs.getString("CATNAME"); cId = rs.getInt("CATID"); } if(cName.isEmpty()&& intid==0){
Page 21
INTO ("
APP.ASSETCATEGORY +
(CATID, +
txtf_catID.getText().toString()
txtf_catName.getText() + "', " + "'" + txtf_catDesc.getText() + "')"); getCatToCbox(); getCatsToCbox(); clear_category(); ViewTable(""); JOptionPane.showMessageDialog(this, "Information Message", WIDTH); if (stmt != null) { stmt.close(); } }else { int opt = JOptionPane.showConfirmDialog(null, "Category Already Exists. Do You Want to "New Category is Saved Successfully",
Overwrite?"); if(opt==JOptionPane.YES_OPTION) { if(cId!=0){ txtf_catID.setText(""+cId);} stmt.executeUpdate("UPDATE CATNAME='"+txtf_catName.getText()+"', WHERE CATID="+txtf_catID.getText()); } clear_category(); ViewTable(""); if (stmt != null) { stmt.close(); } } } catch(SQLException e){ APP.ASSETCATEGORY SET
CATDESCRIPTION='"+txtf_catDesc.getText()+"'
Page 22
JOptionPane.showMessageDialog(this, "There is a problem in JavaDB statement:" + e, "Warning", WIDTH); } } private void deleteById(String id) { Connection con = null; try{ Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); con = DriverManager.getConnection("jdbc:derby://localhost:1527/assets_db", "jamol", }
"jamol"); try{ Statement st = con.createStatement(); String sql = "DELETE FROM APP.ASSETCATEGORY WHERE CATID="+id; int delete = st.executeUpdate(sql); } catch (SQLException s){ System.out.println("SQL statement is not executed!"); } } catch (Exception e){ } } private void deleteAssetById(String assetId){ Connection con = null;
Page 23
"jamol"); try{ Statement st = con.createStatement(); String sql = "DELETE FROM APP.FIXEDASSETS WHERE ID="+assetId; int delete = st.executeUpdate(sql); } catch (SQLException s){ JOptionPane.showMessageDialog(this, "There is a problem in JavaDB statement:" + s, "Warning", WIDTH); } } catch (Exception e){ } } private void btn_deleteActionPerformed(java.awt.event.ActionEvent evt) { int[] col, row; catTable.setColumnSelectionInterval(1, 2); col = catTable.getSelectedColumns(); row = catTable.getSelectedRows(); if(row.length < 1){ JOptionPane.showMessageDialog(this, WIDTH); "No Row Selected", "Information Message",
Page 24
} else { int option = JOptionPane.showConfirmDialog(null, "Do You Really Want to Delete?"); if(option==JOptionPane.YES_OPTION) {
for(int i=0; i<row.length; i++){ //System.out.println(row[i]); String str = ""+catTable.getValueAt(row[i], col[0]); String strcat = ""+catTable.getValueAt(row[i], col[1]); deleteById(str); cbox_cats.removeItem(strcat); cbox_cat.removeItem(strcat); } try{ ViewTable(""); clear_category(); if(row.length == 1){ JOptionPane.showMessageDialog(this, "Selected Row is Deleted", "Information Message", WIDTH); } else if(row.length > 1){ JOptionPane.showMessageDialog(this, "Selected Rows are Deleted", "Information Message", WIDTH);
Page 25
} else{ JOptionPane.showMessageDialog(this, "No Rows Selected", "Information Message", WIDTH); } } catch (SQLException s){ System.out.println("Statement is not executed!"); } } } } private void btn_assetsActionPerformed(java.awt.event.ActionEvent evt) { try{ getCatToCbox(); getCatsToCbox(); getLifetimesToCbox(); refreshListContent(); } catch (SQLException e ) { JOptionPane.showMessageDialog(null, "SQL Syntax Error"); } internalFrameAssets.setVisible(true); newAssetPanel.setVisible(false); //System.out.println(cbox_cats.getSelectedIndex());}
Page 26
7.0 References
Au, E. &Makower, D. (1996) Java Programming Basics. MIS:Press Ben Shneiderman (1998) Designing the User Interface, Addison-Wesley, 3rd Ed, Bentley, L & Whitten, J (2007).System Analysis & Design for the Global Enterprise. 7th ed Bloch, J. (2008) Addison-Wesley Java seriesThe Java series.2nd ed. Addison-Wesley Campione, M., Walrath, K. &Huml, A. (2001) The JavaTM Tutorial, Third Edition. Pearson Education Inc. Addison Wesley Eckel, B. (2009) Thinking in Java. 3rd ed. Prentice Hall PTR Jenny Preece (1994), Human-Computer Interaction, Addison-Wesley, 1st Edition Lewis, J. & Loftus, W. (2009) Java Software Solutions. 6thed. Pearson Education Inc. Addison Wesley O'Neil, J.(1998) Teach yourself Java. McGraw-Hill Professional
Page 27