Role-Coll Role Based Collaboration Software

Size: px
Start display at page:

Download "Role-Coll Role Based Collaboration Software"

Transcription

1 Department of Computer Science University of Nevada, Reno Role-Coll Role Based Collaboration Software CS /12/2006 Software Team: Harold De Armas, Erik Hanchett, Raymond Lee, Zack Norcross Business Team: Mark Tyman, Max Volger Internal Advisors: Sergiu Dascalu, PhD., Gary Valiere PhD.

2 Table of Contents TABLE OF CONTENTS... 2 INTRODUCTION... 3 CLASS SUMMARY... 4 SOURCE CODE... 5 AdminFrame Class... 5 ALlImagesFilter Class BackgroundPanal Class ConnectionManager Class EditUserFrame Class GetUser Class GIFFilter Class JPGFilter Class LoginFrame Class MainFrame Class NewUserFrame Class PNGFilter Class SaveUser Class SkinBean Class UserBean Class User Class UserTreeNode Class XML DOCUMENTATION POM XML User s XML of 62

3 Introduction The objective of Role-Coll is to be an interactive collaboration product. The proposed product will allow multiple interested parties to have visual input on a document or conversation. However the product will have built in intelligence as to which users input will be displayed by default and which users input to shared only if it is approved by their superior. The aptly named Role-Coll, short for Role-based collaboration software, will allow users to share collaboration freely at their own level and their superiors will be able to filter the input from all of their subordinates. Role-Coll will also incorporate modularity to allow for different modules to be plugged in as the subject of the conversations change. The primary focus for Roll-Coll is a music plug-in that allows collaboration among an entire band or orchestra on a multiple pieces of music. Each section would be able to make their own notes on their music and the conductor could filter out only the notes that he saw useful. Collaborative software allows multiple users to contribute to multiple documents in a way that every user contributes to the creation of the document they are working on. This is a very powerful tool because it allows input from a variety of users and the users feel part of the creative process. Collaboration software could be improved in two key areas, by adding roles to each of the users, and by allowing for more variation in the documents that are being collaborated on. Our project will be focused on two key improvements to collaboration software. The first improvement is the addition of user roles. In current collaboration software, everyone is editing the same document, and everyone has the same privileges to do so. With the addition of roles, users are organized in a hierarchy such that there are leaders and subordinates. Another important distinction is that every user has a copy of the document that is unique to them. Everyone may make changes to their document that is not reflected in the collaborated document, much like making liner notes in a real document. The roles come in place when a leader submits a change to subordinates. The change is applied automatically and users have the ability to modify it in their own document. If a subordinate has a modification they would like to make in a document, they would need to submit it to the leader for approval. Then the leader can chose to apply the modification to the group s document or discard it. The second improvement proposed to collaboration software is that of how a document is defined. Collaboration does not only happen on text documents and whiteboards. Engineers need to create and edit circuit diagrams and using a simple whiteboard would be tedious. The particular interest of this group is music notation. In rehearsals of symphony orchestras, a large collaboration effort is taking place where the document being collaborated on is a piece of sheet music. Sheet music is another unique document that is not easily described by a text editor or a whiteboard. Along with the ability to enforce roles in the collaboration process, the software should also allow for a wider variety of collaboration through the implementation of modules. For future consideration, Role-Coll should come with the standard modules that allow for text editing and use of a whiteboard. Role-Coll should feature an interface by which a user can create a system the application can use to display, interpret, and modify a collaborative document. Since Role-Coll is a modular project, future developments can include a larger library of modules. Role-Coll might be enhanced to support a wider 3 of 62

4 variety of modules that were not thought of in initial conception. A web interface could be created so users can view and make basic changes to the document. Roll-Coll has completed the preliminary research and work necessary to create a prototype graphical user interface. Roll-Coll has also completed research on the XML specification for MusicXML files that will be the basis of this software. Database diagrams have been created to describe the internal structure and storage of the documents as well as the roles for use in the music setting. Finally class outlines and initial methods have been prototyped to serve the needs of Roll-Coll. Class Summary No. Class Name Description 1 AdminFrame This class displays the admin form 2 AllImagesFilter This filter will show all jpg, gif, and png files aswell as all folders in the directory. 3 BackgroundPanel Background for all panels 4 ConnectionManager This class creates a static connection to the database 5 EditUserFrame Frame for dispaying user information 6 GetUser This class will retreive user data from the database 7 GIFFilter Filters all files except.gif files from the file dialog box 8 JPGFilter Filters all files except.jpg files from the file dialog box 9 LoginFrame This class validates a users credintals and opens the correct frame 10 MainFrame This class displays the main UI screen 11 NewUserFrame Admin frame used for adding users 12 PNGFilter Filters all files except.jpg files from the file dialog box 13 SaveUser This class is used to update user information in the database. 14 SkinBean Controls the skin of the user interface 15 UserBean This class contains all of the user information in an object 16 Users This class loads the user tree in the main and admin frame 17 UserTreeNode Extention of a the DefaultMutableTreeNode class A UserBean was added containing the users information 4 of 62

5 Source Code AdminFrame Class /* * AdminFrame.java * * Created on November 26, 2006, 4:49 PM package rolecoll.ui; import javax.imageio.imageio; import javax.swing.tree.defaulttreecellrenderer; import javax.swing.tree.treepath; import rolecoll.beans.skinbean; import rolecoll.beans.userbean; import rolecoll.beans.usertreenode; import rolecoll.beans.users; * This class displays the admin form public class AdminFrame extends javax.swing.jframe { private TreePath path = null; Creates new form AdminFrame public AdminFrame() { // get users Users.getUsers( // init skin SkinBean.initSkin(SkinBean.skin initcomponents( // Update only one tree instance DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer)jTree1.getCellRenderer( // Remove the icons renderer.setleaficon(null renderer.setclosedicon(null renderer.setopenicon(null personalpanel.grabfocus( This method is called from within the constructor to * initialize the form. // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initcomponents() { jscrollpane1 = new javax.swing.jscrollpane( jtree1 = new javax.swing.jtree(users.usertree jtabbedpane1 = new javax.swing.jtabbedpane( personalpanel = new javax.swing.jpanel( firstnametext = new javax.swing.jtextfield( 5 of 62

6 lastnametext = new javax.swing.jtextfield( jlabel1 = new javax.swing.jlabel( jlabel2 = new javax.swing.jlabel( loginpanel = new javax.swing.jpanel( jlabel3 = new javax.swing.jlabel( jlabel4 = new javax.swing.jlabel( logintext = new javax.swing.jtextfield( passwordtext = new javax.swing.jtextfield( jlabel5 = new javax.swing.jlabel( idtext = new javax.swing.jtextfield( rolepanel = new javax.swing.jpanel( rolename = new javax.swing.jtextfield( jlabel6 = new javax.swing.jlabel( jlabel7 = new javax.swing.jlabel( rolepriority = new javax.swing.jtextfield( jlabel8 = new javax.swing.jlabel( superiorid = new javax.swing.jtextfield( jmenubar2 = new javax.swing.jmenubar( jmenu2 = new javax.swing.jmenu( jmenuitem1 = new javax.swing.jmenuitem( jmenuitem2 = new javax.swing.jmenuitem( jmenuitem3 = new javax.swing.jmenuitem( setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close settitle("role-coll" setcursor(new java.awt.cursor(java.awt.cursor.default_cursor) try{ seticonimage(imageio.read(mainframe.class.getclassloader().getresource( "images/rolecoll.jpg")) catch(exception e){ e.printstacktrace( setresizable(false jtree1.addfocuslistener(new java.awt.event.focusadapter() { public void focusgained(java.awt.event.focusevent evt) { jtree1focusgained(evt jscrollpane1.setviewportview(jtree1 jtabbedpane1.setfont(new java.awt.font("verdana", 1, 12) personalpanel.setfont(new java.awt.font("verdana", 1, 12) firstnametext.setfont(new java.awt.font("verdana", 0, 12) lastnametext.setfont(new java.awt.font("verdana", 0, 12) jlabel1.setfont(new java.awt.font("verdana", 1, 12) jlabel1.settext("first Name" jlabel2.setfont(new java.awt.font("verdana", 1, 12) jlabel2.settext("last Name" org.jdesktop.layout.grouplayout personalpanellayout = new org.jdesktop.layout.grouplayout(personalpanel 6 of 62

7 personalpanel.setlayout(personalpanellayout personalpanellayout.sethorizontalgroup( personalpanellayout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(personalpanellayout.createsequentialgroup().addcontainergap().add(personalpanellayout.createparallelgroup(org.jdesktop.layout.groupl ayout.leading).add(jlabel1).add(jlabel2)).add(12, 12, 12).add(personalPanelLayout.createParallelGroup(org.jdesktop.layout.GroupL ayout.trailing).add(lastnametext, 185, Short.MAX_VALUE).add(firstNameText, 185, Short.MAX_VALUE)).addContainerGap()) personalpanellayout.setverticalgroup( personalpanellayout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(personalpanellayout.createsequentialgroup().addcontainergap().add(personalpanellayout.createparallelgroup(org.jdesktop.layout.groupl ayout.baseline).add(jlabel1).add(firstnametext, org.jdesktop.layout.grouplayout.preferred_size)).add(12, 12, 12).add(personalPanelLayout.createParallelGroup(org.jdesktop.layout.GroupL ayout.baseline).add(jlabel2).add(lastnametext, org.jdesktop.layout.grouplayout.preferred_size)).addcontainergap(198, Short.MAX_VALUE)) jtabbedpane1.addtab("personal", personalpanel loginpanel.setfont(new java.awt.font("verdana", 1, 12) jlabel3.setfont(new java.awt.font("verdana", 1, 12) jlabel3.settext("login" jlabel4.setfont(new java.awt.font("verdana", 1, 12) jlabel4.settext("password" logintext.setfont(new java.awt.font("verdana", 0, 12) 7 of 62

8 passwordtext.setfont(new java.awt.font("verdana", 0, 12) jlabel5.setfont(new java.awt.font("verdana", 1, 12) jlabel5.settext("user ID" idtext.seteditable(false idtext.setfont(new java.awt.font("verdana", 0, 12) org.jdesktop.layout.grouplayout loginpanellayout = new org.jdesktop.layout.grouplayout(loginpanel loginpanel.setlayout(loginpanellayout loginpanellayout.sethorizontalgroup( loginpanellayout.createparallelgroup(org.jdesktop.layout.grouplayout.le ADING).add(loginPanelLayout.createSequentialGroup().addContainerGap().add(loginPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayo ut.leading).add(jlabel4).add(jlabel3).add(jlabel5)).add(24, 24, 24).add(loginPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayo ut.leading).add(logintext, 180, Short.MAX_VALUE).add(passwordText, 180, Short.MAX_VALUE).add(idText, 59, org.jdesktop.layout.grouplayout.preferred_size)).addcontainergap()) loginpanellayout.setverticalgroup( loginpanellayout.createparallelgroup(org.jdesktop.layout.grouplayout.le ADING).add(loginPanelLayout.createSequentialGroup().addContainerGap().add(loginPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayo ut.baseline).add(logintext, org.jdesktop.layout.grouplayout.preferred_size).add(jlabel3)).add(9, 9, 9).add(loginPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayo ut.baseline).add(passwordtext, 8 of 62

9 org.jdesktop.layout.grouplayout.preferred_size).add(jlabel4)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(loginpanellayout.createparallelgroup(org.jdesktop.layout.grouplayo ut.baseline).add(jlabel5).add(idtext, org.jdesktop.layout.grouplayout.preferred_size)).addcontainergap(173, Short.MAX_VALUE)) jtabbedpane1.addtab("login", loginpanel rolename.setfont(new java.awt.font("verdana", 0, 12) jlabel6.setfont(new java.awt.font("verdana", 1, 12) jlabel6.settext("role Name" jlabel7.setfont(new java.awt.font("verdana", 1, 12) jlabel7.settext("role Priority" rolepriority.setfont(new java.awt.font("verdana", 0, 12) jlabel8.setfont(new java.awt.font("verdana", 1, 12) jlabel8.settext("superior ID" superiorid.setfont(new java.awt.font("verdana", 0, 12) org.jdesktop.layout.grouplayout rolepanellayout = new org.jdesktop.layout.grouplayout(rolepanel rolepanel.setlayout(rolepanellayout rolepanellayout.sethorizontalgroup( rolepanellayout.createparallelgroup(org.jdesktop.layout.grouplayout.lea DING).add(rolePanelLayout.createSequentialGroup().addContainerGap().add(rolePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayou t.leading).add(jlabel6).add(jlabel7).add(jlabel8)).add(17, 17, 17).add(rolePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayou t.leading).add(rolename, 169, Short.MAX_VALUE).add(rolePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayou t.trailing, false) 9 of 62

10 .add(org.jdesktop.layout.grouplayout.leading, rolepriority).add(org.jdesktop.layout.grouplayout.leading, superiorid, 32, Short.MAX_VALUE))).addContainerGap()) rolepanellayout.setverticalgroup( rolepanellayout.createparallelgroup(org.jdesktop.layout.grouplayout.lea DING).add(rolePanelLayout.createSequentialGroup().addContainerGap().add(rolePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayou t.baseline).add(jlabel6).add(rolename, org.jdesktop.layout.grouplayout.preferred_size)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(rolepanellayout.createparallelgroup(org.jdesktop.layout.grouplayou t.baseline).add(jlabel7).add(rolepriority, org.jdesktop.layout.grouplayout.preferred_size)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(rolepanellayout.createparallelgroup(org.jdesktop.layout.grouplayou t.baseline).add(jlabel8).add(superiorid, org.jdesktop.layout.grouplayout.preferred_size)).addcontainergap(175, Short.MAX_VALUE)) jtabbedpane1.addtab("role", rolepanel jmenu2.settext("file" jmenuitem1.settext("add New User" jmenuitem1.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jmenuitem1actionperformed(evt jmenu2.add(jmenuitem1 10 of 62

11 jmenuitem2.settext("edit Selected User" jmenuitem2.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jmenuitem2actionperformed(evt jmenu2.add(jmenuitem2 jmenuitem3.settext("delete Selected User" jmenuitem3.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jmenuitem3actionperformed(evt jmenu2.add(jmenuitem3 jmenubar2.add(jmenu2 setjmenubar(jmenubar2 org.jdesktop.layout.grouplayout layout = new org.jdesktop.layout.grouplayout(getcontentpane() getcontentpane().setlayout(layout layout.sethorizontalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(layout.createsequentialgroup().add(jscrollpane1, 100, org.jdesktop.layout.grouplayout.preferred_size).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(jtabbedpane1, 294, Short.MAX_VALUE)) layout.setverticalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(jscrollpane1, 291, Short.MAX_VALUE).add(org.jdesktop.layout.GroupLayout.TRAILING, jtabbedpane1, 291, Short.MAX_VALUE) pack( // </editor-fold>//gen-end:initcomponents * This method deletes the currently selected user 11 of 62

12 private void jmenuitem3actionperformed(java.awt.event.actionevent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed // TODO add your handling code here: delete user //GEN-LAST:event_jMenuItem3ActionPerformed * This method opens a form to edit the currently selected users information private void jmenuitem2actionperformed(java.awt.event.actionevent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed new BackgroundPanel().setVisible(true new EditUserFrame().setVisible(true //GEN-LAST:event_jMenuItem2ActionPerformed * This method opens a new user dialog private void jmenuitem1actionperformed(java.awt.event.actionevent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed new BackgroundPanel().setVisible(true new NewUserFrame().setVisible(true //GEN-LAST:event_jMenuItem1ActionPerformed * This method populates the user information on the admin form private void jtree1focusgained(java.awt.event.focusevent evt) {//GEN-FIRST:event_jTree1FocusGained path = jtree1.getselectionpath( if(path!= null){ UserTreeNode usernode = (UserTreeNode)path.getLastPathComponent( UserBean userinfo = usernode.getuserinfo( firstnametext.settext(userinfo.getuserfirstname() lastnametext.settext(userinfo.getuserlastname() logintext.settext(userinfo.getuserlogin() passwordtext.settext(userinfo.getpassword() idtext.settext(userinfo.getuserid() rolename.settext(userinfo.getrolename() rolepriority.settext(integer.tostring(userinfo.getrolepriority()) superiorid.settext(userinfo.getsuperiorid() logintext.updateui( personalpanel.grabfocus( //GEN-LAST:event_jTree1FocusGained * Runs the form args the command line arguments public static void main(string args[]) { java.awt.eventqueue.invokelater(new Runnable() { public void run() { new BackgroundPanel().setVisible(true 12 of 62

13 new AdminFrame().setVisible(true // Variables declaration - do not modify//gen-begin:variables private javax.swing.jtextfield firstnametext; private javax.swing.jtextfield idtext; private javax.swing.jlabel jlabel1; private javax.swing.jlabel jlabel2; private javax.swing.jlabel jlabel3; private javax.swing.jlabel jlabel4; private javax.swing.jlabel jlabel5; private javax.swing.jlabel jlabel6; private javax.swing.jlabel jlabel7; private javax.swing.jlabel jlabel8; private javax.swing.jmenu jmenu2; private javax.swing.jmenubar jmenubar2; private javax.swing.jmenuitem jmenuitem1; private javax.swing.jmenuitem jmenuitem2; private javax.swing.jmenuitem jmenuitem3; private javax.swing.jscrollpane jscrollpane1; private javax.swing.jtabbedpane jtabbedpane1; private javax.swing.jtree jtree1; private javax.swing.jtextfield lastnametext; private javax.swing.jpanel loginpanel; private javax.swing.jtextfield logintext; private javax.swing.jtextfield passwordtext; private javax.swing.jpanel personalpanel; private javax.swing.jtextfield rolename; private javax.swing.jpanel rolepanel; private javax.swing.jtextfield rolepriority; private javax.swing.jtextfield superiorid; // End of variables declaration//gen-end:variables 13 of 62

14 ALlImagesFilter Class /* * AllImagesFilter.java * * Created on November 25, 2006, 6:19 PM * package rolecoll.beans; import java.io.file; import javax.swing.filechooser.filefilter; * This filter will show all jpg, gif, and png files aswell as all folders in * the directory. public class AllImagesFilter extends FileFilter { * This method will return the accepted status of an input file. file - input file boolean - returns the accepted status of a file public boolean accept(file file) { String filename = file.getname( if(filename.endswith(".jpg") filename.endswith(".gif") filename.endswith(".png") file.isdirectory()){ return true; else{ return false; * This method returns the decription of the filter for the file dialog * drop down menu. String - Description public String getdescription() { return "All Images"; 14 of 62

15 BackgroundPanal Class /* * BackgroundPanel.java * * Created on November 25, 2006, 1:46 PM package rolecoll.ui; import com.l2fprod.gui.plaf.skin.skin; import com.l2fprod.gui.plaf.skin.skinlookandfeel; import javax.swing.uimanager; import rolecoll.beans.users; * Background for all panels public class BackgroundPanel extends javax.swing.jpanel { Creates new form BackgroundPanel public BackgroundPanel() { try{ // first tell SkinLF which theme to use Skin skintouse = SkinLookAndFeel.loadThemePack(Users.class.getClassLoader().getResource( "themes/aquathemepack.zip") SkinLookAndFeel.setSkin(skinToUse // finally set the Skin Look And Feel UIManager.setLookAndFeel(new SkinLookAndFeel() catch(exception e){ e.printstacktrace( initcomponents( * Runs the Panel stand alone. public static void main(string args[]) { java.awt.eventqueue.invokelater(new Runnable() { public void run() { new BackgroundPanel().setVisible(true This method is called from within the constructor to * initialize the form. // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initcomponents() { 15 of 62

16 org.jdesktop.layout.grouplayout layout = new org.jdesktop.layout.grouplayout(this this.setlayout(layout layout.sethorizontalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(0, 278, Short.MAX_VALUE) layout.setverticalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(0, 129, Short.MAX_VALUE) // </editor-fold>//gen-end:initcomponents // Variables declaration - do not modify//gen-begin:variables // End of variables declaration//gen-end:variables 16 of 62

17 ConnectionManager Class /* * ConnectionManager.java * * Created on December 9, 2006, 12:42 PM package rolecoll.beans; import java.io.ioexception; import java.sql.connection; import java.sql.drivermanager; import java.sql.sqlexception; import java.util.properties; * This class creates a static connection to the database public class ConnectionManager { * Static connection to the database private static Connection connection = null; private static final String DB_HOST = "rolecoll.database.host"; private static final String DB_PORT = "rolecoll.database.port"; private static final String DB_NAME = "rolecoll.database.name"; private static final String DB_USER = "rolecoll.database.user"; private static final String DB_PASSWORD = "rolecoll.database.password"; private static final String DB_TYPE = "rolecoll.database.type"; private static final String DB_DRIVER = "rolecoll.database.driver"; private static final String PROP_FILE = "database.properties"; private Properties properties = new Properties( Creates a new instance of ConnectionManager public ConnectionManager() throws SQLException, IOException, ClassNotFoundException { // read properties file properties.load(this.getclass().getclassloader().getresourceasstream(pr OP_FILE) // instanciate the driver class Class.forName(properties.getProperty(DB_DRIVER) // Connect to dabase String host = properties.getproperty(db_host String port = properties.getproperty(db_port String dbname = properties.getproperty(db_name String user = properties.getproperty(db_user String password = properties.getproperty(db_password 17 of 62

18 String type = properties.getproperty(db_type dbname; String url = "jdbc:" + type + "://" + host + ":" + port + "/" + connection = DriverManager.getConnection(url, user, password * This method destroys the connection public static void destroy() throws SQLException { if(connection!= null){ connection.close( * This method returns the status of the connection boolean public boolean isconnected() throws SQLException { return!connection.isclosed( * This method returns the static connection Connection public static Connection getconnection(){ return connection; 18 of 62

19 EditUserFrame Class /* * NewUserFrame.java * * Created on December 7, 2006, 8:19 PM package rolecoll.ui; import javax.imageio.imageio; import rolecoll.beans.skinbean; import rolecoll.beans.users; * Frame for dispaying user information public class EditUserFrame extends javax.swing.jframe { Creates new form NewUserFrame public EditUserFrame() { Users.getUsers( SkinBean.initSkin(SkinBean.skin initcomponents( This method is called from within the constructor to * initialize the form. // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initcomponents() { jtabbedpane1 = new javax.swing.jtabbedpane( jpanel1 = new javax.swing.jpanel( jtextfield1 = new javax.swing.jtextfield( jtextfield2 = new javax.swing.jtextfield( jlabel1 = new javax.swing.jlabel( jlabel2 = new javax.swing.jlabel( jpanel2 = new javax.swing.jpanel( jtextfield3 = new javax.swing.jtextfield( jtextfield4 = new javax.swing.jtextfield( jlabel3 = new javax.swing.jlabel( jlabel4 = new javax.swing.jlabel( jpanel3 = new javax.swing.jpanel( jtextfield5 = new javax.swing.jtextfield( jtextfield6 = new javax.swing.jtextfield( jlabel5 = new javax.swing.jlabel( jlabel6 = new javax.swing.jlabel( jtextfield7 = new javax.swing.jtextfield( jlabel7 = new javax.swing.jlabel( jbutton1 = new javax.swing.jbutton( jbutton2 = new javax.swing.jbutton( setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close settitle("enter User Information" 19 of 62

20 try{ seticonimage(imageio.read(edituserframe.class.getclassloader().getresou rce("images/rolecoll.jpg")) catch(exception e){ e.printstacktrace( setresizable(false jtabbedpane1.setfont(new java.awt.font("verdana", 1, 12) jtextfield1.setcolumns(20 jtextfield1.setfont(new java.awt.font("verdana", 0, 12) jtextfield2.setcolumns(20 jtextfield2.setfont(new java.awt.font("verdana", 0, 12) jlabel1.setfont(new java.awt.font("verdana", 1, 12) jlabel1.settext("first Name" jlabel2.setfont(new java.awt.font("verdana", 1, 12) jlabel2.settext("last Name" org.jdesktop.layout.grouplayout jpanel1layout = new org.jdesktop.layout.grouplayout(jpanel1 jpanel1.setlayout(jpanel1layout jpanel1layout.sethorizontalgroup( jpanel1layout.createparallelgroup(org.jdesktop.layout.grouplayout.leadi NG).add(jPanel1Layout.createSequentialGroup().add(25, 25, 25).add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. LEADING).add(jLabel1).add(jLabel2)).add(35, 35, 35).add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. TRAILING).add(jTextField1, org.jdesktop.layout.grouplayout.preferred_size).add(jtextfield2, org.jdesktop.layout.grouplayout.preferred_size)).addcontainergap(54, Short.MAX_VALUE)) jpanel1layout.setverticalgroup( jpanel1layout.createparallelgroup(org.jdesktop.layout.grouplayout.leadi NG).add(jPanel1Layout.createSequentialGroup().add(20, 20, 20) 20 of 62

21 .add(jpanel1layout.createparallelgroup(org.jdesktop.layout.grouplayout. BASELINE).add(jLabel1).add(jTextField1, org.jdesktop.layout.grouplayout.preferred_size)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(jpanel1layout.createparallelgroup(org.jdesktop.layout.grouplayout. BASELINE).add(jLabel2).add(jTextField2, org.jdesktop.layout.grouplayout.preferred_size)).addcontainergap(42, Short.MAX_VALUE)) jtabbedpane1.addtab("personal", jpanel1 jtextfield3.setcolumns(20 jtextfield3.setfont(new java.awt.font("verdana", 0, 12) jtextfield4.setfont(new java.awt.font("verdana", 0, 12) jlabel3.setfont(new java.awt.font("verdana", 1, 12) jlabel3.settext("user Name" jlabel4.setfont(new java.awt.font("verdana", 1, 12) jlabel4.settext("password" org.jdesktop.layout.grouplayout jpanel2layout = new org.jdesktop.layout.grouplayout(jpanel2 jpanel2.setlayout(jpanel2layout jpanel2layout.sethorizontalgroup( jpanel2layout.createparallelgroup(org.jdesktop.layout.grouplayout.leadi NG).add(jPanel2Layout.createSequentialGroup().add(24, 24, 24).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. LEADING).add(jLabel3).add(jLabel4)).add(37, 37, 37).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. TRAILING, false).add(jtextfield4).add(jtextfield3)).add(52, 52, 52)) jpanel2layout.setverticalgroup( 21 of 62

22 jpanel2layout.createparallelgroup(org.jdesktop.layout.grouplayout.leadi NG).add(jPanel2Layout.createSequentialGroup().add(20, 20, 20).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. BASELINE).add(jLabel3).add(jTextField3, org.jdesktop.layout.grouplayout.preferred_size)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(jpanel2layout.createparallelgroup(org.jdesktop.layout.grouplayout. BASELINE).add(jLabel4).add(jTextField4, 21, org.jdesktop.layout.grouplayout.preferred_size)).addcontainergap(42, Short.MAX_VALUE)) jtabbedpane1.addtab("login", jpanel2 jtextfield5.setcolumns(20 jtextfield5.setfont(new java.awt.font("verdana", 0, 12) jtextfield6.setcolumns(3 jtextfield6.setfont(new java.awt.font("verdana", 0, 12) jlabel5.setfont(new java.awt.font("verdana", 1, 12) jlabel5.settext("role Name" jlabel6.setfont(new java.awt.font("verdana", 1, 12) jlabel6.settext("priority" jtextfield7.setcolumns(5 jtextfield7.setfont(new java.awt.font("verdana", 0, 12) jlabel7.setfont(new java.awt.font("verdana", 1, 12) jlabel7.settext("superior ID" org.jdesktop.layout.grouplayout jpanel3layout = new org.jdesktop.layout.grouplayout(jpanel3 jpanel3.setlayout(jpanel3layout jpanel3layout.sethorizontalgroup( jpanel3layout.createparallelgroup(org.jdesktop.layout.grouplayout.leadi NG).add(jPanel3Layout.createSequentialGroup().add(24, 24, 24).add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. LEADING).add(jLabel6) 22 of 62

23 .add(jlabel5).add(jlabel7)).add(38, 38, 38).add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. LEADING).add(jTextField6, org.jdesktop.layout.grouplayout.preferred_size).add(jtextfield5, org.jdesktop.layout.grouplayout.preferred_size).add(jtextfield7, org.jdesktop.layout.grouplayout.preferred_size)).addcontainergap(47, Short.MAX_VALUE)) jpanel3layout.setverticalgroup( jpanel3layout.createparallelgroup(org.jdesktop.layout.grouplayout.leadi NG).add(jPanel3Layout.createSequentialGroup().addContainerGap().add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. BASELINE).add(jLabel5).add(jTextField5, org.jdesktop.layout.grouplayout.preferred_size)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(jpanel3layout.createparallelgroup(org.jdesktop.layout.grouplayout. BASELINE).add(jLabel6).add(jTextField6, org.jdesktop.layout.grouplayout.preferred_size)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(jpanel3layout.createparallelgroup(org.jdesktop.layout.grouplayout. BASELINE).add(jLabel7).add(jTextField7, org.jdesktop.layout.grouplayout.preferred_size)).addcontainergap(22, Short.MAX_VALUE)) jtabbedpane1.addtab("role", jpanel3 23 of 62

24 jbutton1.setfont(new java.awt.font("verdana", 1, 12) jbutton1.settext("cancel" jbutton2.setfont(new java.awt.font("verdana", 1, 12) jbutton2.settext("ok" org.jdesktop.layout.grouplayout layout = new org.jdesktop.layout.grouplayout(getcontentpane() getcontentpane().setlayout(layout layout.sethorizontalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(org.jdesktop.layout.grouplayout.trailing, layout.createsequentialgroup().addcontainergap(272, Short.MAX_VALUE).add(jButton2).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jButton1).add(14, 14, 14)).add(jTabbedPane1) layout.setverticalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(layout.createsequentialgroup().add(jtabbedpane1, 138, org.jdesktop.layout.grouplayout.preferred_size).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(layout.createparallelgroup(org.jdesktop.layout.grouplayout.baselin E).add(jButton2).add(jButton1)).addContainerGap( Short.MAX_VALUE)) pack( // </editor-fold>//gen-end:initcomponents * runs the frame stand alone args the command line arguments public static void main(string args[]) { java.awt.eventqueue.invokelater(new Runnable() { public void run() { new NewUserFrame().setVisible(true // Variables declaration - do not modify//gen-begin:variables 24 of 62

25 private javax.swing.jbutton jbutton1; private javax.swing.jbutton jbutton2; private javax.swing.jlabel jlabel1; private javax.swing.jlabel jlabel2; private javax.swing.jlabel jlabel3; private javax.swing.jlabel jlabel4; private javax.swing.jlabel jlabel5; private javax.swing.jlabel jlabel6; private javax.swing.jlabel jlabel7; private javax.swing.jpanel jpanel1; private javax.swing.jpanel jpanel2; private javax.swing.jpanel jpanel3; private javax.swing.jtabbedpane jtabbedpane1; private javax.swing.jtextfield jtextfield1; private javax.swing.jtextfield jtextfield2; private javax.swing.jtextfield jtextfield3; private javax.swing.jtextfield jtextfield4; private javax.swing.jtextfield jtextfield5; private javax.swing.jtextfield jtextfield6; private javax.swing.jtextfield jtextfield7; // End of variables declaration//gen-end:variables 25 of 62

26 GetUser Class /* * GetUser.java * * Created on December 10, 2006, 6:05 PM package rolecoll.beans; import java.util.arraylist; import java.util.collection; * This class will retreive user data from the database public class GetUser { private static final String SELECT_SINGLE = "SELECT * FROM USERS" + " WHERE id=%id%"; private static final String SELECT_ALL = "SELECT * FROM USERS" + " WHERE id=%id%"; all Creates a new instance of GetUser public GetUser() { * This method returns a collection of user beans populated with * of the user data in the database Collection - collection of user beans public static Collection selectallusers(){ return new ArrayList( * This method returns a user bean given a user id id - users id number UserBean - user data from the database public static UserBean selectuser(string id){ // todo return new UserBean( 26 of 62

27 GIFFilter Class /* * GIFFilter.java * * Created on November 25, 2006, 6:19 PM package rolecoll.beans; import java.io.file; import javax.swing.filechooser.filefilter; * Filters all files except.gif files from the file dialog box public class GIFFilter extends FileFilter { box file - file in question boolean - the filtered status of a file public boolean accept(file file) { String filename = file.getname( return filename.endswith(".gif" String - discription of the filter for the file dialog public String getdescription() { return "*.gif"; 27 of 62

28 JPGFilter Class /* * JPGFilter.java * * Created on November 25, 2006, 6:19 PM package rolecoll.beans; import java.io.file; import javax.swing.filechooser.filefilter; * Filters all files except.jpg files from the file dialog box public class JPGFilter extends FileFilter { box file - file in question boolean - the filtered status of a file public boolean accept(file file) { String filename = file.getname( return filename.endswith(".jpg" String - discription of the filter for the file dialog public String getdescription() { return "*.jpg"; 28 of 62

29 LoginFrame Class /* * LoginFrame.java * * Created on November 25, 2006, 1:57 PM package rolecoll.ui; import java.net.url; import javax.imageio.imageio; import javax.swing.uimanager; import rolecoll.beans.skinbean; import rolecoll.beans.userbean; import rolecoll.beans.users; * This class validates a users credintals and opens the correct frame public class LoginFrame extends javax.swing.jframe { Creates new form LoginFrame public LoginFrame() { SkinBean.initSkin(SkinBean.skin Users.getUsers( initcomponents( This method is called from within the constructor to * initialize the form. // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initcomponents() { jpanel1 = new javax.swing.jpanel( jtextfield1 = new javax.swing.jtextfield( jlabel1 = new javax.swing.jlabel( jlabel2 = new javax.swing.jlabel( jbutton1 = new javax.swing.jbutton( jpasswordfield1 = new javax.swing.jpasswordfield( jcombobox1 = new javax.swing.jcombobox( jlabel3 = new javax.swing.jlabel( setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close settitle("role-coll Login" try{ seticonimage(imageio.read(loginframe.class.getclassloader().getresource ("images/rolecoll.jpg")) catch(exception e){ e.printstacktrace( setname("loginframe" setresizable(false 29 of 62

30 jtextfield1.setcolumns(20 jtextfield1.setfont(new java.awt.font("verdana", 0, 12) jtextfield1.setautoscrolls(false jlabel1.setfont(new java.awt.font("verdana", 1, 12) jlabel1.settext("login" jlabel2.setfont(new java.awt.font("verdana", 1, 12) jlabel2.settext("password" { { jbutton1.setfont(new java.awt.font("verdana", 1, 12) jbutton1.settext("ok" jbutton1.addactionlistener(new java.awt.event.actionlistener() public void actionperformed(java.awt.event.actionevent evt) jbutton1actionperformed(evt jpasswordfield1.setfont(new java.awt.font("verdana", 0, 12) jcombobox1.setfont(new java.awt.font("verdana", 0, 12) jcombobox1.setmodel(new javax.swing.defaultcomboboxmodel(new String[] { "Default", "Aqua", "Ninja", "Tiger", "Toxic" ) jcombobox1.additemlistener(new java.awt.event.itemlistener() { public void itemstatechanged(java.awt.event.itemevent evt) { jcombobox1itemstatechanged(evt jlabel3.setfont(new java.awt.font("verdana", 1, 12) jlabel3.settext("skin Theme" org.jdesktop.layout.grouplayout jpanel1layout = new org.jdesktop.layout.grouplayout(jpanel1 jpanel1.setlayout(jpanel1layout jpanel1layout.sethorizontalgroup( jpanel1layout.createparallelgroup(org.jdesktop.layout.grouplayout.leadi NG).add(org.jdesktop.layout.GroupLayout.TRAILING, jpanel1layout.createsequentialgroup().addcontainergap().add(jpanel1layout.createparallelgroup(org.jdesktop.layout.grouplayout. TRAILING).add(jButton1, 67, org.jdesktop.layout.grouplayout.preferred_size).add(org.jdesktop.layout.grouplayout.leading, jpanel1layout.createsequentialgroup().add(jpanel1layout.createparallelgroup(org.jdesktop.layout.grouplayout. LEADING).add(jLabel1) 30 of 62

31 .add(jlabel2).add(jlabel3)).add(22, 22, 22).add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. LEADING).add(org.jdesktop.layout.GroupLayout.TRAILING, jcombobox1, 0, 124, Short.MAX_VALUE).add(org.jdesktop.layout.GroupLayout.TRAILING, jpasswordfield1, 124, Short.MAX_VALUE).add(jTextField1, 124, Short.MAX_VALUE)))).add(19, 19, 19)) jpanel1layout.setverticalgroup( jpanel1layout.createparallelgroup(org.jdesktop.layout.grouplayout.leadi NG).add(jPanel1Layout.createSequentialGroup().addContainerGap().add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. BASELINE).add(jLabel1).add(jTextField1, org.jdesktop.layout.grouplayout.preferred_size)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(jpanel1layout.createparallelgroup(org.jdesktop.layout.grouplayout. BASELINE).add(jLabel2).add(jPasswordField1, org.jdesktop.layout.grouplayout.preferred_size)).addpreferredgap(org.jdesktop.layout.layoutstyle.related, Short.MAX_VALUE).add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout. BASELINE).add(jComboBox1, org.jdesktop.layout.grouplayout.preferred_size).add(jlabel3)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(jbutton1).add(29, 29, 29)) 31 of 62

32 org.jdesktop.layout.grouplayout layout = new org.jdesktop.layout.grouplayout(getcontentpane() getcontentpane().setlayout(layout layout.sethorizontalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(jpanel1, Short.MAX_VALUE) layout.setverticalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(jpanel1, 129, org.jdesktop.layout.grouplayout.preferred_size) pack( // </editor-fold>//gen-end:initcomponents * This method sets the skin chosen by the user private void jcombobox1itemstatechanged(java.awt.event.itemevent evt) {//GEN-FIRST:event_jComboBox1ItemStateChanged SkinBean.skin = (String)jComboBox1.getSelectedItem( //GEN-LAST:event_jComboBox1ItemStateChanged * This method checks the creditals of a user and opens the correct frame * for that user private void jbutton1actionperformed(java.awt.event.actionevent evt) {//GEN-FIRST:event_jButton1ActionPerformed // get text from fields String user = jtextfield1.gettext( String password = String.valueOf(jPasswordField1.getPassword() // get user bean UserBean userbean = (UserBean)Users.userMap.get(user if(user!= null && password!= null){ // check password if(userbean.getpassword().equals(password)){ // open main frame if(!userbean.isadmin()){ this.setvisible(false new BackgroundPanel().setVisible(true new MainFrame().setVisible(true // open admin frame else{ this.setvisible(false new BackgroundPanel().setVisible(true new AdminFrame().setVisible(true else{ 32 of 62

33 // todo display error //GEN-LAST:event_jButton1ActionPerformed * Run the login frame args the command line arguments public static void main(string args[]) { java.awt.eventqueue.invokelater(new Runnable() { public void run() { new LoginFrame().setVisible(true // Variables declaration - do not modify//gen-begin:variables private javax.swing.jbutton jbutton1; private javax.swing.jcombobox jcombobox1; private javax.swing.jlabel jlabel1; private javax.swing.jlabel jlabel2; private javax.swing.jlabel jlabel3; private javax.swing.jpanel jpanel1; private javax.swing.jpasswordfield jpasswordfield1; private javax.swing.jtextfield jtextfield1; // End of variables declaration//gen-end:variables 33 of 62

34 MainFrame Class /* * MainFrame.java * * Created on November 20, 2006, 9:53 PM package rolecoll.ui; import com.l2fprod.gui.plaf.skin.skin; import com.l2fprod.gui.plaf.skin.skinlookandfeel; import java.awt.color; import java.awt.component; import java.awt.container; import java.awt.point; import java.awt.event.mouseevent; import java.awt.event.mouselistener; import java.awt.event.mousemotionlistener; import java.awt.image.bufferedimage; import java.io.file; import java.io.ioexception; import javax.imageio.imageio; import javax.swing.imageicon; import javax.swing.jbutton; import javax.swing.jfilechooser; import javax.swing.jframe; import javax.swing.jinternalframe; import javax.swing.jlabel; import javax.swing.jlayeredpane; import javax.swing.jpanel; import javax.swing.jscrollpane; import javax.swing.jtextarea; import javax.swing.jtextpane; import javax.swing.jtoolbar; import javax.swing.jviewport; import javax.swing.jwindow; import javax.swing.lookandfeel; import javax.swing.uimanager; import javax.swing.unsupportedlookandfeelexception; import javax.swing.filechooser.filefilter; import javax.swing.tree.defaulttreecellrenderer; import rolecoll.beans.*; * This class displays the main UI screen public class MainFrame extends JFrame { private JTextPane textpane = null; private int xadjustment; private int yadjustment; Creates new form MainFrame public MainFrame() { // init skin 34 of 62

35 SkinBean.initSkin(SkinBean.skin initcomponents( // Update only one tree instance DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer)jTree1.getCellRenderer( // Remove the tree icons renderer.setleaficon(null renderer.setclosedicon(null renderer.setopenicon(null This method is called from within the constructor to * initialize the form. // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initcomponents() { jscrollpane1 = new javax.swing.jscrollpane( jtree1 = jtree1 = new javax.swing.jtree(users.usertree jtabbedpane1 = new javax.swing.jtabbedpane( jlabel1 = new javax.swing.jlabel( jlabel2 = new javax.swing.jlabel( jtoolbar1 = new JToolBar(null, JToolBar.VERTICAL try{ jbutton1 = new JButton( new ImageIcon( ImageIO.read(MainFrame.class.getClassLoader().getResource("images/open. jpg"))) catch(exception e){ e.printstacktrace( try{ jbutton2 = new JButton( new ImageIcon( ImageIO.read(MainFrame.class.getClassLoader().getResource("images/save. jpg"))) catch(exception e){ e.printstacktrace( try{ jbutton3 = new JButton( new ImageIcon( ImageIO.read(MainFrame.class.getClassLoader().getResource("images/note. jpg"))) catch(exception e){ e.printstacktrace( try{ jbutton4 = new JButton( new ImageIcon( 35 of 62

36 ImageIO.read(MainFrame.class.getClassLoader().getResource("images/FullS creen.jpg"))) catch(exception e){ e.printstacktrace( jmenubar1 = new javax.swing.jmenubar( jmenu1 = new javax.swing.jmenu( jmenuitem1 = new javax.swing.jmenuitem( jmenu2 = new javax.swing.jmenu( jmenu3 = new javax.swing.jmenu( setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close settitle("role-coll" try{ seticonimage(imageio.read(mainframe.class.getclassloader().getresource( "images/rolecoll.jpg")) catch(exception e){ e.printstacktrace( jtree1.setfont(new java.awt.font("verdana", 1, 11) jscrollpane1.setviewportview(jtree1 jtabbedpane1.settabplacement(javax.swing.jtabbedpane.bottom jlabel1.setfont(new java.awt.font("verdana", 1, 14) jlabel1.sethorizontalalignment(javax.swing.swingconstants.center jlabel1.settext("users Tree" jlabel2.setfont(new java.awt.font("verdana", 1, 14) jlabel2.sethorizontalalignment(javax.swing.swingconstants.center jlabel2.settext("document Panel" { { jtoolbar1.setrollover(true jtoolbar1.setfont(new java.awt.font("verdana", 0, 12) jbutton1.setfont(new java.awt.font("verdana", 1, 12) jbutton1.settooltiptext("open" jbutton1.addactionlistener(new java.awt.event.actionlistener() public void actionperformed(java.awt.event.actionevent evt) jbutton1actionperformed(evt jtoolbar1.add(jbutton1 jbutton2.setfont(new java.awt.font("verdana", 1, 12) jbutton2.settooltiptext("save" jtoolbar1.add(jbutton2 jbutton3.setfont(new java.awt.font("verdana", 1, 12) jbutton3.settooltiptext("new Note" 36 of 62

37 { { jbutton3.addactionlistener(new java.awt.event.actionlistener() public void actionperformed(java.awt.event.actionevent evt) jbutton3actionperformed(evt jtoolbar1.add(jbutton3 jbutton4.setfont(new java.awt.font("verdana", 1, 12) jbutton4.settooltiptext("full Screen" jtoolbar1.add(jbutton4 jmenu1.settext("file" jmenuitem1.settext("open" jmenuitem1.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jmenuitem1actionperformed(evt jmenu1.add(jmenuitem1 jmenubar1.add(jmenu1 jmenu2.settext("edit" jmenubar1.add(jmenu2 jmenu3.settext("help" jmenubar1.add(jmenu3 setjmenubar(jmenubar1 org.jdesktop.layout.grouplayout layout = new org.jdesktop.layout.grouplayout(getcontentpane() getcontentpane().setlayout(layout layout.sethorizontalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(layout.createsequentialgroup().add(layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading, false).add(jlabel1, Short.MAX_VALUE).add(jScrollPane1, 135, Short.MAX_VALUE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILIN G) 37 of 62

38 .add(jtabbedpane1, 280, Short.MAX_VALUE).add(jLabel2, 280, Short.MAX_VALUE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jToolBar1, 35, org.jdesktop.layout.grouplayout.preferred_size).add(0, 0, 0)) layout.setverticalgroup( layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading).add(layout.createsequentialgroup().add(layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading ).add(jlabel2).add(jlabel1, 18, org.jdesktop.layout.grouplayout.preferred_size)).addpreferredgap(org.jdesktop.layout.layoutstyle.related).add(layout.createparallelgroup(org.jdesktop.layout.grouplayout.leading ).add(layout.createsequentialgroup().add(jtoolbar1, org.jdesktop.layout.grouplayout.preferred_size).add(260, 260, 260)).add(org.jdesktop.layout.GroupLayout.TRAILING, jscrollpane1, 285, Short.MAX_VALUE).add(org.jdesktop.layout.GroupLayout.TRAILING, jtabbedpane1, 285, Short.MAX_VALUE))) pack( // </editor-fold>//gen-end:initcomponents * This method creates a new note on the currently selected document private void jbutton3actionperformed(java.awt.event.actionevent evt) {//GEN-FIRST:event_jButton3ActionPerformed JInternalFrame note = new JInternalFrame( note.setopaque(false note.setbackground(new Color(255, 255, 255, 0) note.setresizable(true note.setclosable(true note.setsize(100, 100 note.setmaximizable(true 38 of 62

39 JTextPane textpane = new JTextPane( textpane.setopaque(false note.getcontentpane().add(textpane note.show( JScrollPane pane = (JScrollPane)jTabbedPane1.getSelectedComponent( JLabel label = (JLabel)((JViewport)pane.getComponent(0)).getComponent(0 label.add(note //GEN-LAST:event_jButton3ActionPerformed /* * This method opens a dialog box for opening documents (tool bar) private void jbutton1actionperformed(java.awt.event.actionevent evt) {//GEN-FIRST:event_jButton1ActionPerformed openaction( //GEN-LAST:event_jButton1ActionPerformed /* * This method opens a dialog box for opening documents (File menu) private void jmenuitem1actionperformed(java.awt.event.actionevent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed openaction( //GEN-LAST:event_jMenuItem1ActionPerformed * Runs the form args the command line arguments public static void main(string args[]) { java.awt.eventqueue.invokelater(new Runnable() { public void run() { new BackgroundPanel().setVisible(true new MainFrame().setVisible(true * This method creates a open dialog used to open a document private void openaction(){ // file dialog JFileChooser chooser = new JFileChooser( // remove "All Files" filter FileFilter[] filters = chooser.getchoosablefilefilters( chooser.removechoosablefilefilter(filters[0] // add jpg filter FileFilter jpgfilter = new JPGFilter( chooser.addchoosablefilefilter(jpgfilter // add gif filter FileFilter giffilter = new GIFFilter( 39 of 62

40 chooser.addchoosablefilefilter(giffilter // add png filter FileFilter pngfilter = new PNGFilter( chooser.addchoosablefilefilter(pngfilter // add bmp filter FileFilter allimagesfilter = new AllImagesFilter( chooser.addchoosablefilefilter(allimagesfilter JFrame frame = new JFrame( chooser.showopendialog(frame // Get the selected file File file = chooser.getselectedfile( String filename = file.getname( BufferedImage image = null; try { image = ImageIO.read(file catch(ioexception e) { System.out.println("read error: " + e.getmessage() ImageIcon icon = new ImageIcon(image JLabel imagelabel = new JLabel(icon JScrollPane imagescroll = new JScrollPane(imageLabel jtabbedpane1.add(filename.substring(0, filename.lastindexof(".")), imagescroll // move selected panel to new panel if(jtabbedpane1.getselectedindex() > -1 ){ jtabbedpane1.setselectedindex(jtabbedpane1.getselectedindex()+1 // Variables declaration - do not modify//gen-begin:variables private javax.swing.jbutton jbutton1; private javax.swing.jbutton jbutton2; private javax.swing.jbutton jbutton3; private javax.swing.jbutton jbutton4; private javax.swing.jlabel jlabel1; private javax.swing.jlabel jlabel2; private javax.swing.jmenu jmenu1; private javax.swing.jmenu jmenu2; private javax.swing.jmenu jmenu3; private javax.swing.jmenubar jmenubar1; private javax.swing.jmenuitem jmenuitem1; private javax.swing.jscrollpane jscrollpane1; private javax.swing.jtabbedpane jtabbedpane1; private javax.swing.jtoolbar jtoolbar1; private javax.swing.jtree jtree1; // End of variables declaration//gen-end:variables private JPanel jpanel2; 40 of 62

/** Creates new form NewJFrame */ public NewJFrame() { initcomponents(); initblogsearch(); //initializes Index List box }

/** Creates new form NewJFrame */ public NewJFrame() { initcomponents(); initblogsearch(); //initializes Index List box } /* * To change this template, choose Tools Templates * and open the template in the editor. */ /* * NewJFrame.java * * Created on Apr 17, 2011, 1:13:13 PM */ /** * * @author Kelli */ import java.io.*;

More information

Java Programming Summer 2008 LAB. Thursday 8/21/2008

Java Programming Summer 2008 LAB. Thursday 8/21/2008 LAB Thursday 8/21/2008 Design and implement the program that contains a timer. When the program starts, the timer shows 00:00:00. When we click the Start button, the timer starts. When we click the Stop

More information

jlabel14 = new javax.swing.jlabel(); jlabel15 = new javax.swing.jlabel(); jlabel16 = new javax.swing.jlabel(); jlabel17 = new javax.swing.

jlabel14 = new javax.swing.jlabel(); jlabel15 = new javax.swing.jlabel(); jlabel16 = new javax.swing.jlabel(); jlabel17 = new javax.swing. 188 APPENDIX 1 { jinternalframe1 = new javax.swing.jinternalframe(); jlabel1 = new javax.swing.jlabel(); jlabel2 = new javax.swing.jlabel(); jlabel3 = new javax.swing.jlabel(); jlabel4 = new javax.swing.jlabel();

More information

Answer on question #61311, Programming & Computer Science / Java

Answer on question #61311, Programming & Computer Science / Java Answer on question #61311, Programming & Computer Science / Java JSP JSF for completion Once the user starts the thread by clicking a button, the program must choose a random image out of an image array,

More information

* To change this license header, choose License Headers in Project Properties.

* To change this license header, choose License Headers in Project Properties. /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools Templates * and open the template in the editor. package tugasumbyjava; /**

More information

* To change this license header, choose License Headers in Project Properties.

* To change this license header, choose License Headers in Project Properties. /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools Templates * and open the template in the editor. */ package calci; /** * *

More information

Appendix I: Software Coding

Appendix I: Software Coding References [1] Ceylon Electricity Board, Statistical Digest 2015, pp 2 [2] Roy Billinton and Ronald N. Allan, Reliability Evaluation of Engineering Systems: Concepts and Techniques, Springer (first published

More information

JAVA CODE JAVA CODE: BINOMIAL TREES OPTION PRICING BINOMIALTREE CLASS PAGE 1

JAVA CODE JAVA CODE: BINOMIAL TREES OPTION PRICING BINOMIALTREE CLASS PAGE 1 CODE JAVA CODE BINOMIAL TREES OPTION PRICING JAVA CODE: BINOMIAL TREES OPTION PRICING BINOMIALTREE CLASS /** * * @author Ioannis Svigkos 2008 */ // This class corresponds to binomial tree option pricing.

More information

INSTITUTO POLITÉCNICO NACIONAL ESCUELA SUPERIOR DE CÓMPUTO

INSTITUTO POLITÉCNICO NACIONAL ESCUELA SUPERIOR DE CÓMPUTO INSTITUTO POLITÉCNICO NACIONAL ESCUELA SUPERIOR DE CÓMPUTO Cryptography Practice 1,2,3 By: Raúl Emmanuel Delgado Díaz de León Professor: M. en C. NIDIA ASUNCIÓN CORTEZ DUARTE February2015 Index Contenido

More information

Department of Computer Science University of Nevada, Reno. Role-Coll. Role Based Collaboration Software. Project Part I: Concept

Department of Computer Science University of Nevada, Reno. Role-Coll. Role Based Collaboration Software. Project Part I: Concept Department of Computer Science University of Nevada, Reno Role-Coll Role Based Collaboration Software Project Part I: Concept Software Team: Harold De Armas, Erik Hanchett, Raymond Lee, Zack Norcross Business

More information

DAFTAR LAMPIRAN. Source Code Java Aplikasi Keyword to Image Renamer Split

DAFTAR LAMPIRAN. Source Code Java Aplikasi Keyword to Image Renamer Split DAFTAR LAMPIRAN Source Code Java Aplikasi Keyword to Image Renamer Split Source Code Menu Utama package spin_text; import java.awt.color; import java.awt.event.actionevent; import java.awt.event.actionlistener;

More information

privateint m, n, smithitemcount, raitaitemcount;

privateint m, n, smithitemcount, raitaitemcount; LISTING PROGRAM /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools Templates * and open the template in the editor. */ package

More information

Role-Coll Role Based Collaboration Software

Role-Coll Role Based Collaboration Software Department of Computer Science University of Nevada, Reno Role-Coll Software Requirements Specification CS 426 11/03/2006 Software Team: Harold De Armas, Erik Hanchett, Raymond Lee, Zack Norcross Business

More information

Travel Agency. Khateeb Engineering Classes. Mini Project. Khateeb Engineering Classes: / Technology to be used

Travel Agency. Khateeb Engineering Classes. Mini Project. Khateeb Engineering Classes: / Technology to be used Khateeb Engineering Classes Mini Project Travel Agency Technology to be used Front end :Java Swings Back End: PHP Myadmin Requirements : 1) Jdk ( version 1.6 or upwards) 2) Netbeans (Version 6.0 or upwards)

More information

Chapter 8. Java continued. CS Hugh Anderson s notes. Page number: 264 ALERT. MCQ test next week. This time. This place.

Chapter 8. Java continued. CS Hugh Anderson s notes. Page number: 264 ALERT. MCQ test next week. This time. This place. Chapter 8 Java continued CS3283 - Hugh Anderson s notes. Page number: 263 ALERT MCQ test next week This time This place Closed book CS3283 - Hugh Anderson s notes. Page number: 264 ALERT Assignment #2

More information

Java continued. Chapter 8 ALERT ALERT. Last week. MCQ test next week. This time. This place. Closed book. Assignment #2 is for groups of 3

Java continued. Chapter 8 ALERT ALERT. Last week. MCQ test next week. This time. This place. Closed book. Assignment #2 is for groups of 3 Chapter 8 Java continued MCQ test next week This time This place Closed book ALERT CS3283 - Hugh Anderson s notes. Page number: 263 CS3283 - Hugh Anderson s notes. Page number: 264 ALERT Last week Assignment

More information

CHAPTER 8 INFERENCE. The concept of Inference would be explained in the following chapter, as the CTBN

CHAPTER 8 INFERENCE. The concept of Inference would be explained in the following chapter, as the CTBN CHAPTER 8 INFERENCE The concept of Inference would be explained in the following chapter, as the CTBN framework has already been detailed on. The chapter begins by answering the most asked queries and

More information

TECHNICAL DOCUMENTATION

TECHNICAL DOCUMENTATION TECHNICAL DOCUMENTATION UNDERSTANDING THE JAVA/XML CODE BINDING IN OPENBRAVO POS AND LITTLE EDITING SPONSORED BY: IT-KAMER COMPANY LTD CEO: Dr.-Ing. Stanley Mungwe SONDI Mikael Steve jobs project Cameroon

More information

Project Helpine Report BANQUET HALL BOOKING

Project Helpine Report BANQUET HALL BOOKING Project Helpine Report BANQUET HALL BOOKING - 1 - BANQUET HALL BOOKING TABLE OF CONTENT Contents Page No. Acknowledgment 3 Declaration 4 1. Introduction & Objectives of the Project 1.1 Introduction 7 1.2

More information

Lampiran A. SOURCE CODE PROGRAM

Lampiran A. SOURCE CODE PROGRAM A-1 Lampiran A. SOURCE CODE PROGRAM Frame Utama package FrameDesign; import ArithmeticSkripsi.ArithmeticCompress; import ArithmeticSkripsi.ArithmeticDecompress; import Deflate.DeflateContoh; import java.io.file;

More information

I.1 Introduction Matisse GUI designer I.2 GroupLayout Basics Sequential and Parallel Arrangements sequential horizontal orientation

I.1 Introduction Matisse GUI designer I.2 GroupLayout Basics Sequential and Parallel Arrangements sequential horizontal orientation I GroupLayout I.1 Introduction Java SE 6 includes a powerful layout manager called GroupLayout, which is the default layout manager in the NetBeans IDE (www.netbeans.org). In this appendix, we overview

More information

Based on slides by Prof. Burton Ma

Based on slides by Prof. Burton Ma Based on slides by Prof. Burton Ma 1 TV - on : boolean - channel : int - volume : int + power(boolean) : void + channel(int) : void + volume(int) : void Model View Controller RemoteControl + togglepower()

More information

PART 23. Java GUI Advanced JList Component. more items.

PART 23. Java GUI Advanced JList Component. more items. PART 23 Java GUI Advanced 23.1 JList Component JList is a component that displays a list of objects. It allows the user to select one or more items. import java.awt.color; import java.awt.eventqueue; import

More information

グラフを表すデータ構造 JAVA での実装

グラフを表すデータ構造 JAVA での実装 グラフを表すデータ構造 JAVA での実装 グラフの構造を記述するクラス パッケージgraphLib graphlib.graph グラフ全体 graphlib.vertex 頂点 頂点を始点とする弧 頂点を2 次元面に表示するための座標 graphlib.arc 弧の始点と終点 クラスの関係 グラフ 弧一覧 弧 弧 頂点 弧 頂点一覧 頂点 頂点 写像 + 頂点 写像 頂点 写像 δ + GRAPH

More information

SampleApp.java. Page 1

SampleApp.java. Page 1 SampleApp.java 1 package msoe.se2030.sequence; 2 3 /** 4 * This app creates a UI and processes data 5 * @author hornick 6 */ 7 public class SampleApp { 8 private UserInterface ui; // the UI for this program

More information

Hanley s Survival Guide for Visual Applications with NetBeans 2.0 Last Updated: 5/20/2015 TABLE OF CONTENTS

Hanley s Survival Guide for Visual Applications with NetBeans 2.0 Last Updated: 5/20/2015 TABLE OF CONTENTS Hanley s Survival Guide for Visual Applications with NetBeans 2.0 Last Updated: 5/20/2015 TABLE OF CONTENTS Glossary of Terms 2-4 Step by Step Instructions 4-7 HWApp 8 HWFrame 9 Never trust a computer

More information

import java.applet.applet; import java.applet.audioclip; import java.net.url; public class Vjesala2 {

import java.applet.applet; import java.applet.audioclip; import java.net.url; public class Vjesala2 { import java.awt.color; import java.awt.flowlayout; import java.awt.font; import java.awt.gridlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jbutton;

More information

COMP16121 Sample Code Lecture 1

COMP16121 Sample Code Lecture 1 COMP16121 Sample Code Lecture 1 Sean Bechhofer, University of Manchester, Manchester, UK sean.bechhofer@manchester.ac.uk 1 SimpleFrame 1 import javax.swing.jframe; 2 3 public class SimpleFrame { 4 5 /*

More information

// autor igre Ivan Programerska sekcija package mine;

// autor igre Ivan Programerska sekcija package mine; // autor igre Ivan Bauk @ Programerska sekcija package mine; import java.awt.color; import java.awt.flowlayout; import java.awt.gridlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener;

More information

Chapter 12 GUI Basics

Chapter 12 GUI Basics Chapter 12 GUI Basics 1 Creating GUI Objects // Create a button with text OK JButton jbtok = new JButton("OK"); // Create a label with text "Enter your name: " JLabel jlblname = new JLabel("Enter your

More information

LAMPIRAN PERANGKAT LUNAK

LAMPIRAN PERANGKAT LUNAK LAMPIRAN PERANGKAT LUNAK package com.fr.core; import com.googlecode.javacv.cpp.opencv_core; import com.googlecode.javacv.cpp.opencv_imgproc; import com.googlecode.javacv.cpp.opencv_objdetect; import java.awt.image.bufferedimage;

More information

Role-Coll Role Based Collaboration Software

Role-Coll Role Based Collaboration Software Department of Computer Science University of Nevada, Reno Role-Coll Role Based Collaboration Software CS 425 3/30/2007 Software Team: Harold De Armas, Erik Hanchett, Raymond Lee, Zack Norcross Business

More information

Role-Coll Role Based Collaboration Software

Role-Coll Role Based Collaboration Software Department of Computer Science University of Nevada, Reno Role-Coll Role Based Collaboration Software CS 425 3/30/2007 Software Team: Harold De Armas, Erik Hanchett, Raymond Lee, Zack Norcross Business

More information

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1 Datenbank-Praktikum Universität zu Lübeck Sommersemester 2006 Lecture: Swing Ho Ngoc Duc 1 Learning objectives GUI applications Font, Color, Image Running Applets as applications Swing Components q q Text

More information

We have several alternatives now, which we need to address. Here is a list of them: 1. How to get HTML interpreted correctly.

We have several alternatives now, which we need to address. Here is a list of them: 1. How to get HTML interpreted correctly. Applets in Java using NetBeans as an IDE Creating an Interactive Browser using JEditorPane (Part 3) C.W. David Department of Chemistry University of Connecticut Storrs, CT 06269-3060 Carl.David@uconn.edu

More information

BROCCOLICCHI Jérôme. Réalisation d'un éditeur permettant d éditer graphiquement (UML étendu) une application conformément au modèle OFL ANNEXES

BROCCOLICCHI Jérôme. Réalisation d'un éditeur permettant d éditer graphiquement (UML étendu) une application conformément au modèle OFL ANNEXES KULAKOWSKI Fabienne BROCCOLICCHI Jérôme Projet LPMI Réalisation d'un éditeur permettant d éditer graphiquement (UML étendu) une application conformément au modèle OFL ANNEXES Responsables : LAHIRE Philippe

More information

Swing UI. Powered by Pentalog. by Vlad Costel Ungureanu for Learn Stuff

Swing UI. Powered by Pentalog. by Vlad Costel Ungureanu for Learn Stuff Swing UI by Vlad Costel Ungureanu for Learn Stuff User Interface Command Line Graphical User Interface (GUI) Tactile User Interface (TUI) Multimedia (voice) Intelligent (gesture recognition) 2 Making the

More information

Exercice G09 (v3) File: Shape.java Project: G09-MiniDraw_v3 1GGE

Exercice G09 (v3) File: Shape.java Project: G09-MiniDraw_v3 1GGE Exercice G09 (v3) File: Shape.java Project: G09-MiniDraw_v3 1GGE public class Shape private Point from; private Point to; private Color color; public Shape(int px1, int py1, int px2, int py2, Color pcolor)

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor: Alan

More information

Prototyping a Swing Interface with the Netbeans IDE GUI Editor

Prototyping a Swing Interface with the Netbeans IDE GUI Editor Prototyping a Swing Interface with the Netbeans IDE GUI Editor Netbeans provides an environment for creating Java applications including a module for GUI design. Here we assume that we have some existing

More information

Introduction to Graphical Interface Programming in Java. Introduction to AWT and Swing

Introduction to Graphical Interface Programming in Java. Introduction to AWT and Swing Introduction to Graphical Interface Programming in Java Introduction to AWT and Swing GUI versus Graphics Programming Graphical User Interface (GUI) Graphics Programming Purpose is to display info and

More information

Chapter 2. Network Chat

Chapter 2. Network Chat Chapter 2. Network Chat In a multi-player game, different players interact with each other. One way of implementing this is to have a centralized server that interacts with each client using a separate

More information

GUI Applications. Let s start with a simple Swing application in Java, and then we will look at the same application in Jython. See Listing 16-1.

GUI Applications. Let s start with a simple Swing application in Java, and then we will look at the same application in Jython. See Listing 16-1. GUI Applications The C implementation of Python comes with Tkinter for writing Graphical User Interfaces (GUIs). The GUI toolkit that you get automatically with Jython is Swing, which is included with

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor:

More information

Goals. Lecture 7 More GUI programming. The application. The application D&D 12. CompSci 230: Semester JFrame subclass: ListOWords

Goals. Lecture 7 More GUI programming. The application. The application D&D 12. CompSci 230: Semester JFrame subclass: ListOWords Goals By the end of this lesson, you should: Lecture 7 More GUI programming 1. Be able to write Java s with JTextField, JList, JCheckBox and JRadioButton components 2. Be able to implement a ButtonGroup

More information

Swing. Component overview. Java UI, summer semester 2017/2018 1

Swing. Component overview. Java UI, summer semester 2017/2018 1 Swing Component overview 1 Label class JLabel for displaying short text image both 2 Buttons many kinds of buttons all of them extends AbstractButton regular button (JButton) "click" button toggle button

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC124, WINTER TERM, 2009 FINAL EXAMINATION 7pm to 10pm, 18 APRIL 2009, Dunning Hall Instructor: Alan McLeod If the

More information

Example: Building a Java GUI

Example: Building a Java GUI Steven Zeil October 25, 2013 Contents 1 Develop the Model 2 2 Develop the layout of those elements 3 3 Add listeners to the elements 9 4 Implement custom drawing 12 1 The StringArt Program To illustrate

More information

Example: Building a Java GUI

Example: Building a Java GUI Steven Zeil October 25, 2013 Contents 1 Develop the Model 3 2 Develop the layout of those elements 4 3 Add listeners to the elements 12 4 Implement custom drawing 15 1 The StringArt Program To illustrate

More information

Exercice G02 (v2) File: MovingBall.java Project: G02-Smileys_v2 1GGE

Exercice G02 (v2) File: MovingBall.java Project: G02-Smileys_v2 1GGE Exercice G02 (v2) File: MovingBall.java Project: G02-Smileys_v2 1GGE public class MovingBall /* * Version 2: * * Solution en ajoutant la classe Emoticon qui hérite de MovingBall et qui dessine le partie

More information

/* * MoraDrill.java * Version last updated 6 April 2010 * Written by John K. Estell * Created on November 30, 2008, 10:22 PM */

/* * MoraDrill.java * Version last updated 6 April 2010 * Written by John K. Estell * Created on November 30, 2008, 10:22 PM */ /* * MoraDrill.java * Version 2.1.0 - last updated 6 April 2010 * Written by John K. Estell * Created on November 30, 2008, 10:22 PM */ package MoraDrill; import java.io.inputstream; import java.awt.*;

More information

17 GUI API: Container 18 Hello world with a GUI 19 GUI API: JLabel 20 GUI API: Container: add() 21 Hello world with a GUI 22 GUI API: JFrame: setdefau

17 GUI API: Container 18 Hello world with a GUI 19 GUI API: JLabel 20 GUI API: Container: add() 21 Hello world with a GUI 22 GUI API: JFrame: setdefau List of Slides 1 Title 2 Chapter 13: Graphical user interfaces 3 Chapter aims 4 Section 2: Example:Hello world with a GUI 5 Aim 6 Hello world with a GUI 7 Hello world with a GUI 8 Package: java.awt and

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Solution HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2007 FINAL EXAMINATION 7pm to 10pm, 10 DECEMBER 2007, Jeffery Hall Instructor: Alan McLeod

More information

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling Handout 12 CS603 Object-Oriented Programming Fall 15 Page 1 of 12 Handout 14 Graphical User Interface (GUI) with Swing, Event Handling The Swing library (javax.swing.*) Contains classes that implement

More information

This document shows the whole program for the implementation of the Withdraw operation specication.

This document shows the whole program for the implementation of the Withdraw operation specication. This document shows the whole program for the implementation of the Withdraw operation specication. * Account.java * 1 package ATM_BasicClasses; 3 import java.util.date; 4 5 public class Account { 6 public

More information

Rizvi College of Arts, Science & Commerce Bandra (W), Mumbai Teaching Plan Academic Year

Rizvi College of Arts, Science & Commerce Bandra (W), Mumbai Teaching Plan Academic Year Academic Year 17-18 Subject: ADVANCE JAVA Class : T.Y.B.Sc. (IT) DIV: Faculty: ARIF PATEL Months JUNE JULY AUGUST Topics to be covered Understanding Layout Manager. Swing: JColorChooser, JComboBox, JFileChooser,

More information

Introduction p. 1 JFC Architecture p. 5 Introduction to JFC p. 7 The JFC 1.2 Extension p. 8 Swing p. 9 Drag and Drop p. 16 Accessibility p.

Introduction p. 1 JFC Architecture p. 5 Introduction to JFC p. 7 The JFC 1.2 Extension p. 8 Swing p. 9 Drag and Drop p. 16 Accessibility p. Introduction p. 1 JFC Architecture p. 5 Introduction to JFC p. 7 The JFC 1.2 Extension p. 8 Swing p. 9 Drag and Drop p. 16 Accessibility p. 17 MVC Architecture p. 19 The MVC Architecture p. 20 Combined

More information

Event Driven Programming

Event Driven Programming Event Driven Programming Part 1 Introduction Chapter 12 CS 2334 University of Oklahoma Brian F. Veale 1 Graphical User Interfaces So far, we have only dealt with console-based programs Run from the console

More information

Swing - JTextField. Adding a text field to the main window (with tooltips and all)

Swing - JTextField. Adding a text field to the main window (with tooltips and all) Swing - JTextField Adding a text field to the main window (with tooltips and all) Prerequisites - before this lecture You should have seen: The lecture on JFrame The lecture on JButton Including having

More information

Is image everything?

Is image everything? Is image everything? Review Computer Graphics technology enables GUIs and computer gaming. GUI's are a fundamental enabling computer technology. Without a GUI there would not be any, or much less: Computer

More information

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Page 1 of 16 SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2005 FINAL EXAMINATION 9am to 12noon, 19 DECEMBER 2005 Instructor: Alan McLeod

More information

Swing. By Iqtidar Ali

Swing. By Iqtidar Ali Swing By Iqtidar Ali Background of Swing We have been looking at AWT (Abstract Window ToolKit) components up till now. Programmers were not comfortable when doing programming with AWT. Bcoz AWT is limited

More information

Graphical User Interface

Graphical User Interface Lecture 10 Graphical User Interface An introduction Sahand Sadjadee sahand.sadjadee@liu.se Programming Fundamentals 725G61 http://www.ida.liu.se/~725g61/ Department of Computer and Information Science

More information

Java Graphical User Interfaces AWT (Abstract Window Toolkit) & Swing

Java Graphical User Interfaces AWT (Abstract Window Toolkit) & Swing Java Graphical User Interfaces AWT (Abstract Window Toolkit) & Swing Rui Moreira Some useful links: http://java.sun.com/docs/books/tutorial/uiswing/toc.html http://www.unix.org.ua/orelly/java-ent/jfc/

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Question Paper CMPE212, FALL TERM, 2012 FINAL EXAMINATION 18 December 2012, 2pm Instructor: Alan McLeod If the instructor is unavailable

More information

Graphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI

Graphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI CBOP3203 Graphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI components like button, text input, scroll bar and others.

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC124, WINTER TERM, 2009 FINAL EXAMINATION 7pm to 10pm, 18 APRIL 2009, Dunning Hall Instructor: Alan McLeod

More information

Part 3: Graphical User Interface (GUI) & Java Applets

Part 3: Graphical User Interface (GUI) & Java Applets 1,QWURGXFWLRQWR-DYD3URJUDPPLQJ (( Part 3: Graphical User Interface (GUI) & Java Applets EE905-GUI 7RSLFV Creating a Window Panels Event Handling Swing GUI Components ƒ Layout Management ƒ Text Field ƒ

More information

CSCI 201L Midterm Written Summer % of course grade

CSCI 201L Midterm Written Summer % of course grade CSCI 201L Summer 2016 10% of course grade 1. Abstract Classes and Interfaces Give two differences between an interface and an abstract class in which all of the methods are abstract. (0.5% + 0.5%) 2. Serialization

More information

PIC 20A GUI with swing

PIC 20A GUI with swing PIC 20A GUI with swing Ernest Ryu UCLA Mathematics Last edited: November 22, 2017 Hello swing Let s create a JFrame. import javax. swing.*; public class Test { public static void main ( String [] args

More information

Java IDE Programming-I

Java IDE Programming-I Java IDE Programming-I Graphical User Interface : is an interface that uses pictures and other graphic entities along with text, to interact with user. User can interact with GUI using mouse click/ or

More information

package As7BattleShip;

package As7BattleShip; package As7BattleShip; Program: BattleshipBoard.java Author: Kevin Nider Date: 11/18/12 Description: Assignment 7: Runs the battleship game Input: ship placement board files and computer player type Output:

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2007 FINAL EXAMINATION 7pm to 10pm, 10 DECEMBER 2007, Jeffery Hall Instructor: Alan McLeod If the

More information

Izpack installer guide

Izpack installer guide Izpack installer guide intagleo systems v 1.0 author: Dev Team Contents Chapter 1 Simple Installer Chapter 2 page 3 page 7 Understanding install.xml Chapter 3 Adding panels to your installer Chapter 4

More information

C: THE PROGRAM Devin Kwok: Dossier 2008

C: THE PROGRAM Devin Kwok: Dossier 2008 C: THE PROGRAM Devin Kwok: Dossier 2008 C.I: Using Good Programming Style C.I.i: Package: com.gmai.kwok.devin.gui.frame Class: Main 01 package com.gmail.kwok.devin.gui.frame; 02 03 import javax.swing.jframe;

More information

Queens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide

Queens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide Topics for Exam 2: Queens College, CUNY Department of Computer Science CS 212 Object-Oriented Programming in Java Practice Exam 2 CS 212 Exam 2 Study Guide Linked Lists define a list node define a singly-linked

More information

Programming with the SCA BB Service Configuration API

Programming with the SCA BB Service Configuration API CHAPTER 3 Programming with the SCA BB Service Configuration API Published: December 23, 2013, Introduction This chapter is a reference for the main classes and methods of the Cisco SCA BB Service Configuration

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2008 FINAL EXAMINATION 7pm to 10pm, 17 DECEMBER 2008, Grant Hall Instructor: Alan McLeod

More information

Programming with the SCA BB Service Configuration API

Programming with the SCA BB Service Configuration API CHAPTER 3 Programming with the SCA BB Service Configuration API Revised: November 8, 2010, Introduction This chapter is a reference for the main classes and methods of the Cisco SCA BB Service Configuration

More information

Writing your own Exceptions. How to extend Exception

Writing your own Exceptions. How to extend Exception Writing your own Exceptions How to extend Exception When would you write your own exception class? When to write your own custom exception is a matter for discussion in your project design team. There

More information

Chapter 13 GUI Basics. Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved.

Chapter 13 GUI Basics. Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved. Chapter 13 GUI Basics 1 Motivations The design of the API for Java GUI programming is an excellent example of how the object-oriented principle is applied. In the chapters that follow, you will learn the

More information

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Page 1 of 16 HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2005 FINAL EXAMINATION 9am to 12noon, 19 DECEMBER 2005 Instructor: Alan McLeod If

More information

GUI (Graphic User Interface) Programming. Part 2 (Chapter 8) Chapter Goals. Events, Event Sources, and Event Listeners. Listeners

GUI (Graphic User Interface) Programming. Part 2 (Chapter 8) Chapter Goals. Events, Event Sources, and Event Listeners. Listeners GUI (Graphic User Interface) Programming Part 2 (Chapter 8) Chapter Goals To understand the Java event model To install action and mouse event listeners To accept input from buttons, text fields, and the

More information

CSCI 201L Midterm Written Fall % of course grade

CSCI 201L Midterm Written Fall % of course grade CSCI 201L Midterm Written Fall 2015 10% of course grade 1. Inheritance Answer the following questions about inheritance. a. Does Java allow overloading, overriding, and redefining of methods? (0.5%) b.

More information

Summary Chapter 25 GUI Components: Part 2

Summary Chapter 25 GUI Components: Part 2 1040 Chapter 25 GUI Components: Part 2 ponent on the line. TheJTextField is added to the content pane with a call to our utility method addcomponent (declared at lines 79 83). MethodaddComponent takes

More information

Swing - JLabel. Adding a text (and HTML) labels to a GUI

Swing - JLabel. Adding a text (and HTML) labels to a GUI Swing - JLabel Adding a text (and HTML) labels to a GUI Prerequisites - before this lecture You should have seen: The lecture on JFrame The lecture on JButton The lectuer on JTextField Including having

More information

Week Chapter Assignment SD Technology Standards. 1,2, Review Knowledge Check JP3.1. Program 5.1. Program 5.1. Program 5.2. Program 5.2. Program 5.

Week Chapter Assignment SD Technology Standards. 1,2, Review Knowledge Check JP3.1. Program 5.1. Program 5.1. Program 5.2. Program 5.2. Program 5. Week Chapter Assignment SD Technology Standards 1,2, Review JP3.1 Review exercises Debugging Exercises 3,4 Arrays, loops and layout managers. (5) Create and implement an external class Write code to create

More information

CSC 569 WINTER 13 GRADUATE PROJECT: NETWORK-BASED IMAGE REPOSITORY

CSC 569 WINTER 13 GRADUATE PROJECT: NETWORK-BASED IMAGE REPOSITORY CSC 569 WINTER 13 GRADUATE PROJECT: NETWORK-BASED IMAGE REPOSITORY PROFESSOR GODFREY MUGANDA 1. Multi-Threaded Network Photo Server You are going to write a system that allows users to store photos on

More information

Graphical User Interfaces in Java - SWING

Graphical User Interfaces in Java - SWING Graphical User Interfaces in Java - SWING Graphical User Interfaces (GUI) Each graphical component that the user can see on the screen corresponds to an object of a class Component: Window Button Menu...

More information

Page 1 of 7. public class EmployeeAryAppletEx extends JApplet

Page 1 of 7. public class EmployeeAryAppletEx extends JApplet CS 209 Spring, 2006 Lab 9: Applets Instructor: J.G. Neal Objectives: To gain experience with: 1. Programming Java applets and the HTML page within which an applet is embedded. 2. The passing of parameters

More information

A Simple Text Editor Application

A Simple Text Editor Application CASE STUDY 7 A Simple Text Editor Application To demonstrate the JTextArea component, fonts, menus, and file choosers we present a simple text editor application. This application allows you to create

More information

CSCI 201L Midterm Written SOLUTION Summer % of course grade

CSCI 201L Midterm Written SOLUTION Summer % of course grade CSCI 201L SOLUTION Summer 2016 10% of course grade 1. Abstract Classes and Interfaces Give two differences between an interface and an abstract class in which all of the methods are abstract. (0.5% + 0.5%)

More information

CSCI 201L Midterm Written SOLUTION Fall % of course grade

CSCI 201L Midterm Written SOLUTION Fall % of course grade CSCI 201L Midterm Written SOLUTION Fall 2015 10% of course grade 1. Inheritance Answer the following questions about inheritance. a. Does Java allow overloading, overriding, and redefining of methods?

More information

Introduction to the JAVA UI classes Advanced HCI IAT351

Introduction to the JAVA UI classes Advanced HCI IAT351 Introduction to the JAVA UI classes Advanced HCI IAT351 Week 3 Lecture 1 17.09.2012 Lyn Bartram lyn@sfu.ca About JFC and Swing JFC Java TM Foundation Classes Encompass a group of features for constructing

More information

The class definition is not a program by itself. It can be used by other programs in order to create objects and use them.

The class definition is not a program by itself. It can be used by other programs in order to create objects and use them. Data Classes and Object-Oriented Programming Data classes can be motivated by the need to create data structures that have grouped together a number of variables of simpler type (ints, Strings, arrays)

More information

Programming with the SCA BB Service Configuration API

Programming with the SCA BB Service Configuration API CHAPTER 3 Programming with the SCA BB Service Configuration API Revised: September 17, 2012, Introduction This chapter is a reference for the main classes and methods of the Cisco SCA BB Service Configuration

More information

JLayeredPane. Depth Constants in JLayeredPane

JLayeredPane. Depth Constants in JLayeredPane JLayeredPane Continuing on Swing Components A layered pane is a Swing container that provides a third dimension for positioning components depth or Z order. The class for the layered pane is JLayeredPane.

More information

First Name: AITI 2004: Exam 2 July 19, 2004

First Name: AITI 2004: Exam 2 July 19, 2004 First Name: AITI 2004: Exam 2 July 19, 2004 Last Name: JSP Track Read Instructions Carefully! This is a 3 hour closed book exam. No calculators are allowed. Please write clearly if we cannot understand

More information

More Swing. CS180 Recitation 12/(04,05)/08

More Swing. CS180 Recitation 12/(04,05)/08 More Swing CS180 Recitation 12/(04,05)/08 Announcements No lecture/labs next week Recitations and evening consulting hours will be held as usual. Debbie's study group on tuesday and office hours on thursday

More information

Trees CSCI 201 Principles of Software Development

Trees CSCI 201 Principles of Software Development Trees CSCI 201 Principles of Software Development Jeffrey Miller, Ph.D. jeffrey.miller@usc.edu Outline Trees Program USC CSCI 201L Trees Overview JTree is a component that displays data in a treelike hierarchy

More information