├── nbproject ├── private │ ├── config.properties │ └── private.properties ├── genfiles.properties ├── project.xml ├── project.properties └── build-impl.xml ├── MTPs-Main-Container.txt ├── README.md ├── dist ├── lib │ └── jade.jar ├── OnlineShopAgent.jar └── README.TXT ├── manifest.mf ├── APDescription.txt └── src └── onlineshopagent ├── Keyword.java ├── PantauHarga.java ├── Item.java ├── PriceCompAgent.java ├── Scrap.java ├── PriceCompUI.form ├── WebScrapAgent.java └── PriceCompUI.java /nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MTPs-Main-Container.txt: -------------------------------------------------------------------------------- 1 | http://IRKHAM:7778/acc 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | arcomagent 2 | ========== 3 | 4 | arcomagent 5 | -------------------------------------------------------------------------------- /dist/lib/jade.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gunturbudi/arcomagent/master/dist/lib/jade.jar -------------------------------------------------------------------------------- /dist/OnlineShopAgent.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gunturbudi/arcomagent/master/dist/OnlineShopAgent.jar -------------------------------------------------------------------------------- /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /APDescription.txt: -------------------------------------------------------------------------------- 1 | ( ap-description :name "192.168.56.1:1100/JADE" :ap-services (set ( ap-service :name fipa.mts.mtp.http.std :type fipa.mts.mtp.http.std :addresses (sequence http://IRKHAM:7778/acc)))) 2 | -------------------------------------------------------------------------------- /nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | application.args=-gui -local-port 1100 Agent1:onlineshopagent.PriceCompAgent;Agent2:onlineshopagent.WebScrapAgent 2 | compile.on.save=true 3 | do.depend=false 4 | do.jar=true 5 | javac.debug=true 6 | javadoc.preview=true 7 | user.properties.file=C:\\Users\\irkham\\.netbeans\\7.0\\build.properties 8 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=c62ee3e1 2 | build.xml.script.CRC32=4c9f7fc4 3 | build.xml.stylesheet.CRC32=28e38971@1.44.1.45 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=c62ee3e1 7 | nbproject/build-impl.xml.script.CRC32=b1534ee4 8 | nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45 9 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | OnlineShopAgent 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dist/README.TXT: -------------------------------------------------------------------------------- 1 | ======================== 2 | BUILD OUTPUT DESCRIPTION 3 | ======================== 4 | 5 | When you build an Java application project that has a main class, the IDE 6 | automatically copies all of the JAR 7 | files on the projects classpath to your projects dist/lib folder. The IDE 8 | also adds each of the JAR files to the Class-Path element in the application 9 | JAR files manifest file (MANIFEST.MF). 10 | 11 | To run the project from the command line, go to the dist folder and 12 | type the following: 13 | 14 | java -jar "OnlineShopAgent.jar" 15 | 16 | To distribute this project, zip up the dist folder (including the lib folder) 17 | and distribute the ZIP file. 18 | 19 | Notes: 20 | 21 | * If two JAR files on the project classpath have the same name, only the first 22 | JAR file is copied to the lib folder. 23 | * Only JAR files are copied to the lib folder. 24 | If the classpath contains other types of files or folders, these files (folders) 25 | are not copied. 26 | * If a library on the projects classpath also has a Class-Path element 27 | specified in the manifest,the content of the Class-Path element has to be on 28 | the projects runtime path. 29 | * To set a main class in a standard Java project, right-click the project node 30 | in the Projects window and choose Properties. Then click Run and enter the 31 | class name in the Main Class field. Alternatively, you can manually type the 32 | class name in the manifest Main-Class element. 33 | -------------------------------------------------------------------------------- /src/onlineshopagent/Keyword.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package pantauharga; 7 | 8 | import java.sql.Connection; 9 | import java.sql.DriverManager; 10 | import java.sql.PreparedStatement; 11 | import java.sql.SQLException; 12 | import java.sql.ResultSet; 13 | 14 | /** 15 | * 16 | * @author Guntur 17 | */ 18 | public class Keyword { 19 | 20 | public Connection con = null; 21 | public PreparedStatement pst = null; 22 | String url_con = "jdbc:mysql://localhost:3306/pantauharga"; 23 | String user = "root"; 24 | String password = ""; 25 | ResultSet rs = null; 26 | 27 | public Keyword() { 28 | } 29 | 30 | public ResultSet getAllQuery() { 31 | try { 32 | con = DriverManager.getConnection(url_con, user, password); 33 | pst = con.prepareStatement("SELECT id,query FROM query WHERE last_executed IS NULL"); 34 | rs = pst.executeQuery(); 35 | 36 | } catch (SQLException ex) { 37 | System.out.println("Terdapat Error di Keyword = " + ex.getMessage()); 38 | } 39 | 40 | return rs; 41 | } 42 | 43 | public void updateLastExecuted(int id) { 44 | try { 45 | con = DriverManager.getConnection(url_con, user, password); 46 | pst = con.prepareStatement("UPDATE query SET last_executed=NOW() WHERE id=" + id); 47 | pst.executeUpdate(); 48 | } catch (SQLException ex) { 49 | System.out.println("Terdapat Error Pertama = " + ex.getMessage()); 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/onlineshopagent/PantauHarga.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package pantauharga; 7 | 8 | import java.util.HashSet; 9 | import java.sql.ResultSet; 10 | import java.sql.SQLException; 11 | import java.util.logging.Level; 12 | import java.util.logging.Logger; 13 | 14 | /** 15 | * 16 | * @author Guntur 17 | */ 18 | public class PantauHarga { 19 | 20 | /** 21 | * @param args the command line arguments 22 | */ 23 | public static void main(String[] args) { 24 | Keyword key = new Keyword(); 25 | Scrap st = new Scrap(); 26 | Item it = new Item(); 27 | 28 | ResultSet queries = key.getAllQuery(); 29 | 30 | try { 31 | while (queries.next()) { 32 | int id = queries.getInt(1); 33 | String keyword = queries.getString(2); 34 | 35 | st.setQueryId(id); 36 | st.setKeyword(keyword); 37 | st.ScrapBhinneka(); 38 | key.updateLastExecuted(id); 39 | } 40 | } catch (SQLException ex) { 41 | Logger.getLogger(PantauHarga.class.getName()).log(Level.SEVERE, null, ex); 42 | } finally { 43 | try { 44 | if (key.rs != null) { 45 | key.rs.close(); 46 | } 47 | if (key.pst != null) { 48 | key.pst.close(); 49 | } 50 | if (key.con != null) { 51 | key.con.close(); 52 | } 53 | 54 | } catch (SQLException ex) { 55 | System.out.println("Terdapat Error di Keyword = " + ex.getMessage()); 56 | } 57 | } 58 | 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.run.all.processors=true 4 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 5 | application.title=OnlineShopAgent 6 | application.vendor=irkham 7 | build.classes.dir=${build.dir}/classes 8 | build.classes.excludes=**/*.java,**/*.form 9 | # This directory is removed when the project is cleaned: 10 | build.dir=build 11 | build.generated.dir=${build.dir}/generated 12 | build.generated.sources.dir=${build.dir}/generated-sources 13 | # Only compile against the classpath explicitly listed here: 14 | build.sysclasspath=ignore 15 | build.test.classes.dir=${build.dir}/test/classes 16 | build.test.results.dir=${build.dir}/test/results 17 | # Uncomment to specify the preferred debugger connection transport: 18 | #debug.transport=dt_socket 19 | debug.classpath=\ 20 | ${run.classpath} 21 | debug.test.classpath=\ 22 | ${run.test.classpath} 23 | # This directory is removed when the project is cleaned: 24 | dist.dir=dist 25 | dist.jar=${dist.dir}/OnlineShopAgent.jar 26 | dist.javadoc.dir=${dist.dir}/javadoc 27 | endorsed.classpath= 28 | excludes= 29 | file.reference.jade.jar=E:\\Irkham\\Kuliah S2\\Semester 3\\Intellligent Agents\\JADE\\JADE-bin-4.3.2\\jade\\lib\\jade.jar 30 | file.reference.jaunt0.9.9.4.jar=E:\\modul+library\\Web Scrapping\\jaunt0.9.9.4\\jaunt0.9.9.4.jar 31 | includes=** 32 | jar.compress=false 33 | javac.classpath=\ 34 | ${file.reference.jade.jar}:\ 35 | ${libs.MySQLDriver.classpath}:\ 36 | ${file.reference.jaunt0.9.9.4.jar} 37 | # Space-separated list of extra javac options 38 | javac.compilerargs= 39 | javac.deprecation=false 40 | javac.processorpath=\ 41 | ${javac.classpath} 42 | javac.source=1.6 43 | javac.target=1.6 44 | javac.test.classpath=\ 45 | ${javac.classpath}:\ 46 | ${build.classes.dir} 47 | javac.test.processorpath=\ 48 | ${javac.test.classpath} 49 | javadoc.additionalparam= 50 | javadoc.author=false 51 | javadoc.encoding=${source.encoding} 52 | javadoc.noindex=false 53 | javadoc.nonavbar=false 54 | javadoc.notree=false 55 | javadoc.private=false 56 | javadoc.splitindex=true 57 | javadoc.use=true 58 | javadoc.version=false 59 | javadoc.windowtitle= 60 | main.class=jade.Boot 61 | manifest.file=manifest.mf 62 | meta.inf.dir=${src.dir}/META-INF 63 | mkdist.disabled=false 64 | platform.active=default_platform 65 | run.classpath=\ 66 | ${javac.classpath}:\ 67 | ${build.classes.dir} 68 | # Space-separated list of JVM arguments used when running the project 69 | # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value 70 | # or test-sys-prop.name=value to set system properties for unit tests): 71 | run.jvmargs= 72 | run.test.classpath=\ 73 | ${javac.test.classpath}:\ 74 | ${build.test.classes.dir} 75 | source.encoding=UTF-8 76 | src.dir=src 77 | test.src.dir=test 78 | -------------------------------------------------------------------------------- /src/onlineshopagent/Item.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package pantauharga; 7 | 8 | import java.sql.Connection; 9 | import java.sql.DriverManager; 10 | import java.sql.PreparedStatement; 11 | import java.sql.SQLException; 12 | 13 | /** 14 | * 15 | * @author Guntur 16 | */ 17 | public class Item { 18 | 19 | int query_id; 20 | String site; 21 | String name; 22 | double price; 23 | double discount; 24 | double price_discount; 25 | String stock; 26 | String description; 27 | String img_url; 28 | String url; 29 | 30 | private Connection con = null; 31 | private PreparedStatement pst = null; 32 | String url_con = "jdbc:mysql://localhost:3306/pantauharga"; 33 | String user = "root"; 34 | String password = ""; 35 | 36 | public Item() { 37 | 38 | } 39 | 40 | public void saveItem() { 41 | try { 42 | con = DriverManager.getConnection(url_con, user, password); 43 | pst = con.prepareStatement("INSERT IGNORE INTO `query_result`\n" 44 | + " (`query_id`,\n" 45 | + " `site`,\n" 46 | + " `name`,\n" 47 | + " `price`,\n" 48 | + " `discount`,\n" 49 | + " `price_discount`,\n" 50 | + " `stock`,\n" 51 | + " `description`,\n" 52 | + " `img_url`,\n" 53 | + " `url`,\n" 54 | + " `created`)\n" 55 | + "VALUES ('"+query_id+"',\n" 56 | + " '"+site+"',\n" 57 | + " '"+name+"',\n" 58 | + " '"+price+"',\n" 59 | + " '"+discount+"',\n" 60 | + " '"+price_discount+"',\n" 61 | + " '"+stock+"',\n" 62 | + " '"+description+"',\n" 63 | + " '"+img_url+"',\n" 64 | + " '"+url+"',\n" 65 | + " NOW())"); 66 | 67 | pst.executeUpdate(); 68 | 69 | } catch (SQLException ex) { 70 | System.out.println("Terdapat Error Pertama = " + ex.getMessage()); 71 | } finally { 72 | 73 | try { 74 | if (pst != null) { 75 | pst.close(); 76 | } 77 | if (con != null) { 78 | con.close(); 79 | } 80 | 81 | } catch (SQLException ex) { 82 | System.out.println("Terdapat Error Kedua = " + ex.getMessage()); 83 | } 84 | } 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/onlineshopagent/PriceCompAgent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package onlineshopagent; 6 | import jade.core.AID; 7 | import jade.core.Agent; 8 | import jade.core.behaviours.CyclicBehaviour; 9 | import jade.domain.AMSService; 10 | import jade.domain.FIPAAgentManagement.AMSAgentDescription; 11 | import jade.domain.FIPAAgentManagement.SearchConstraints; 12 | import jade.domain.FIPAException; 13 | import jade.lang.acl.ACLMessage; 14 | import java.net.InetAddress; 15 | import java.net.UnknownHostException; 16 | import java.util.logging.Level; 17 | import java.util.logging.Logger; 18 | 19 | import java.util.HashSet; 20 | import java.sql.ResultSet; 21 | import java.sql.SQLException; 22 | import java.util.logging.Level; 23 | import java.util.logging.Logger; 24 | /** 25 | * 26 | * @author irkham 27 | */ 28 | public class PriceCompAgent extends Agent { 29 | static int val; 30 | static boolean sendmsg; 31 | ACLMessage receivemsg2; 32 | PriceCompUI pcu; 33 | String agent2Name; 34 | String ipaddress; 35 | protected void setup() 36 | { 37 | try { 38 | pcu = new PriceCompUI(); 39 | pcu.setVisible(true); 40 | addBehaviour(new SendMessage()); 41 | addBehaviour(new ReceiveMessage()); 42 | InetAddress IP=InetAddress.getLocalHost(); 43 | System.out.println("IP of my system is := "+IP.getHostAddress()); 44 | ipaddress = IP.getHostAddress(); 45 | SearchConstraints sc = new SearchConstraints(); 46 | sc.setMaxResults(Long.MAX_VALUE); 47 | AMSAgentDescription[] ams = AMSService.search(this, new AMSAgentDescription(), sc); 48 | System.out.println("Jumlah = "+ams.length); 49 | for(int i=0;i"); 56 | Elements prices = userAgent.doc.findEvery(""); 57 | Elements srcs = userAgent.doc.findEvery("
  • "); 58 | String[] item_title = new String[100]; 59 | double[][] item_price = new double[3][100]; 60 | String[] item_img = new String[100]; 61 | String[] item_src = new String[100]; 62 | 63 | int i = 0; 64 | for (Element title : titles) { 65 | item_title[i] = title.getText().trim(); 66 | i++; 67 | } 68 | i = 0; 69 | for (Element src : srcs) { 70 | item_src[i] = src.getElement(0).getAt("href"); 71 | item_img[i] = src.getElement(0).getElement(0).getAt("src"); 72 | i++; 73 | } 74 | i = 0; 75 | for (Element price : prices) { 76 | String price_normal = price.getText(); 77 | System.out.println(price_normal); 78 | if ("Rp".equals(price_normal.trim())) { 79 | price_normal = price.getElement(0).getElement(0).getElement(0).getElement(0).getElement(0).getText(); 80 | String price_discount = price.getElement(0).getElement(0).getElement(0).getElement(1).getText(); 81 | String discount = price.getElement(0).getElement(0).getElement(0).getElement(2).getElement(1).getText(); 82 | 83 | item_price[0][i] = Double.parseDouble(price_normal.replaceAll(",", "").replaceAll("Rp", "").trim()); 84 | item_price[1][i] = Double.parseDouble(price_discount.replaceAll(",", "").replaceAll("Rp", "").trim()); 85 | item_price[2][i] = Double.parseDouble(discount.replaceAll("-", "").replaceAll("%", "").trim()); 86 | items.stock = "Ada"; 87 | } else if ("Call".equals(price_normal.replaceAll(",", "").replaceAll("Rp", "").trim())) { 88 | item_price[0][i] = 0; 89 | item_price[1][i] = 0; 90 | item_price[2][i] = 0; 91 | items.stock = "Call"; 92 | } else { 93 | item_price[0][i] = Double.parseDouble(price_normal.replaceAll(",", "").replaceAll("Rp", "").trim()); 94 | item_price[1][i] = Double.parseDouble(price_normal.replaceAll(",", "").replaceAll("Rp", "").trim()); 95 | item_price[2][i] = 0; 96 | items.stock = "Ada"; 97 | } 98 | i++; 99 | } 100 | 101 | 102 | int scraped = 0; 103 | for (int j = 0; j < item_title.length; j++) { 104 | if ("".equals(item_title[j])) { 105 | continue; 106 | } 107 | 108 | items.query_id = this.query_id; 109 | items.name = item_title[j]; 110 | items.price = item_price[0][j]; 111 | items.discount = item_price[2][j]; 112 | items.price_discount = item_price[1][j]; 113 | items.img_url = item_img[j]; 114 | items.url = item_src[j]; 115 | items.description = ""; 116 | 117 | items.saveItem(); 118 | scraped++; 119 | } 120 | System.out.println("Scraped in Bhinneka.com (" + urlSearch + ") = " + scraped); 121 | 122 | } catch (JauntException e) { //if title element isn't found or HTTP/connection error occurs, handle JauntException. 123 | System.out.println("Terdapat Error Akses = " + urlBhinneka + urlSearch); 124 | System.err.println(e); 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/onlineshopagent/PriceCompUI.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /src/onlineshopagent/WebScrapAgent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package onlineshopagent; 6 | import jade.core.AID; 7 | import jade.core.Agent; 8 | import jade.core.behaviours.CyclicBehaviour; 9 | import jade.domain.AMSService; 10 | import jade.domain.FIPAAgentManagement.AMSAgentDescription; 11 | import jade.domain.FIPAAgentManagement.SearchConstraints; 12 | import jade.domain.FIPAException; 13 | import jade.lang.acl.ACLMessage; 14 | import java.net.InetAddress; 15 | import java.net.UnknownHostException; 16 | import java.util.logging.Level; 17 | import java.util.logging.Logger; 18 | 19 | import java.util.HashSet; 20 | import java.sql.ResultSet; 21 | import java.sql.SQLException; 22 | import java.util.logging.Level; 23 | import java.util.logging.Logger; 24 | /** 25 | * 26 | * @author irkham 27 | */ 28 | public class WebScrapAgent extends Agent { 29 | //ReceiveGui rg; 30 | ACLMessage receivemsg; 31 | String ipaddress; 32 | String agent1Name; 33 | static boolean sendmsg2; 34 | 35 | @Override 36 | protected void setup() 37 | { 38 | try { 39 | InetAddress IP = InetAddress.getLocalHost(); 40 | System.out.println("IP of my system is := " + IP.getHostAddress()); 41 | ipaddress = IP.getHostAddress(); 42 | addBehaviour(new ReceiveMessage()); 43 | addBehaviour(new SendMessage()); 44 | System.out.println("IP of my system is := "+IP.getHostAddress()); 45 | ipaddress = IP.getHostAddress(); 46 | SearchConstraints sc = new SearchConstraints(); 47 | sc.setMaxResults(Long.MAX_VALUE); 48 | AMSAgentDescription[] ams = AMSService.search(this, new AMSAgentDescription(), sc); 49 | System.out.println("Jumlah = "+ams.length); 50 | for(int i=0;i//GEN-BEGIN:initComponents 112 | private void initComponents() { 113 | 114 | jLabel1 = new javax.swing.JLabel(); 115 | inputTxt = new javax.swing.JTextField(); 116 | jButton1 = new javax.swing.JButton(); 117 | jScrollPane2 = new javax.swing.JScrollPane(); 118 | jTable2 = new javax.swing.JTable(); 119 | 120 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 121 | 122 | jLabel1.setText("What do you want to buy ?"); 123 | 124 | inputTxt.addActionListener(new java.awt.event.ActionListener() { 125 | public void actionPerformed(java.awt.event.ActionEvent evt) { 126 | inputTxtActionPerformed(evt); 127 | } 128 | }); 129 | 130 | jButton1.setText("Find"); 131 | jButton1.addActionListener(new java.awt.event.ActionListener() { 132 | public void actionPerformed(java.awt.event.ActionEvent evt) { 133 | jButton1ActionPerformed(evt); 134 | } 135 | }); 136 | 137 | jTable2.setModel(new javax.swing.table.DefaultTableModel( 138 | new Object [][] { 139 | 140 | }, 141 | new String [] { 142 | 143 | } 144 | )); 145 | jScrollPane2.setViewportView(jTable2); 146 | 147 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 148 | getContentPane().setLayout(layout); 149 | layout.setHorizontalGroup( 150 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 151 | .addGroup(layout.createSequentialGroup() 152 | .addContainerGap() 153 | .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 726, javax.swing.GroupLayout.PREFERRED_SIZE) 154 | .addContainerGap()) 155 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 156 | .addContainerGap(318, Short.MAX_VALUE) 157 | .addComponent(jLabel1) 158 | .addGap(297, 297, 297)) 159 | .addGroup(layout.createSequentialGroup() 160 | .addGap(317, 317, 317) 161 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) 162 | .addContainerGap(302, Short.MAX_VALUE)) 163 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 164 | .addContainerGap(288, Short.MAX_VALUE) 165 | .addComponent(inputTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) 166 | .addGap(285, 285, 285)) 167 | ); 168 | layout.setVerticalGroup( 169 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 170 | .addGroup(layout.createSequentialGroup() 171 | .addContainerGap() 172 | .addComponent(jLabel1) 173 | .addGap(11, 11, 11) 174 | .addComponent(inputTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) 175 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 176 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) 177 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE) 178 | .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE) 179 | .addContainerGap()) 180 | ); 181 | 182 | pack(); 183 | }// //GEN-END:initComponents 184 | 185 | private void inputTxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inputTxtActionPerformed 186 | // TODO add your handling code here: 187 | 188 | }//GEN-LAST:event_inputTxtActionPerformed 189 | 190 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed 191 | // TODO add your handling code here: 192 | PriceCompAgent.sendmsg = true; 193 | Insert(); 194 | }//GEN-LAST:event_jButton1ActionPerformed 195 | 196 | /** 197 | * @param args the command line arguments 198 | */ 199 | public static void main(String args[]) { 200 | /* Set the Nimbus look and feel */ 201 | // 202 | /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. 203 | * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 204 | */ 205 | try { 206 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 207 | if ("Nimbus".equals(info.getName())) { 208 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 209 | break; 210 | } 211 | } 212 | } catch (ClassNotFoundException ex) { 213 | java.util.logging.Logger.getLogger(PriceCompUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 214 | } catch (InstantiationException ex) { 215 | java.util.logging.Logger.getLogger(PriceCompUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 216 | } catch (IllegalAccessException ex) { 217 | java.util.logging.Logger.getLogger(PriceCompUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 218 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 219 | java.util.logging.Logger.getLogger(PriceCompUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 220 | } 221 | // 222 | 223 | /* Create and display the form */ 224 | java.awt.EventQueue.invokeLater(new Runnable() { 225 | 226 | public void run() { 227 | new PriceCompUI().setVisible(true); 228 | } 229 | }); 230 | } 231 | // Variables declaration - do not modify//GEN-BEGIN:variables 232 | private javax.swing.JTextField inputTxt; 233 | private javax.swing.JButton jButton1; 234 | private javax.swing.JLabel jLabel1; 235 | private javax.swing.JScrollPane jScrollPane2; 236 | public javax.swing.JTable jTable2; 237 | // End of variables declaration//GEN-END:variables 238 | } 239 | -------------------------------------------------------------------------------- /nbproject/build-impl.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | Must set src.dir 209 | Must set test.src.dir 210 | Must set build.dir 211 | Must set dist.dir 212 | Must set build.classes.dir 213 | Must set dist.javadoc.dir 214 | Must set build.test.classes.dir 215 | Must set build.test.results.dir 216 | Must set build.classes.excludes 217 | Must set dist.jar 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | Must set javac.includes 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | Must set JVM to use for profiling in profiler.info.jvm 405 | Must set profiler agent JVM arguments in profiler.info.jvmargs.agent 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | Must select some files in the IDE or set javac.includes 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | To run this application from the command line without Ant, try: 659 | 660 | 661 | 662 | 663 | 664 | 665 | java -cp "${run.classpath.with.dist.jar}" ${main.class} 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | To run this application from the command line without Ant, try: 691 | 692 | java -jar "${dist.jar.resolved}" 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | Must select one file in the IDE or set run.class 722 | 723 | 724 | 725 | Must select one file in the IDE or set run.class 726 | 727 | 728 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | Must select one file in the IDE or set debug.class 753 | 754 | 755 | 756 | 757 | Must select one file in the IDE or set debug.class 758 | 759 | 760 | 761 | 762 | Must set fix.includes 763 | 764 | 765 | 766 | 767 | 768 | 769 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | Must select one file in the IDE or set profile.class 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | Must select some files in the IDE or set javac.includes 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | Some tests failed; see details above. 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | Must select some files in the IDE or set test.includes 932 | 933 | 934 | 935 | Some tests failed; see details above. 936 | 937 | 938 | 943 | 944 | Must select one file in the IDE or set test.class 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 974 | 975 | Must select one file in the IDE or set applet.url 976 | 977 | 978 | 979 | 980 | 981 | 982 | 987 | 988 | Must select one file in the IDE or set applet.url 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | --------------------------------------------------------------------------------