• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作業部屋の使い方を試しています。


Commit MetaInfo

Revision34 (tree)
Time2014-07-05 18:15:42
Authortuna_p

Log Message

(empty log message)

Change Summary

Incremental Difference

--- HtmlTest2/src/test1/Frame1.java (revision 33)
+++ HtmlTest2/src/test1/Frame1.java (revision 34)
@@ -13,7 +13,7 @@
1313 import org.jdesktop.observablecollections.ObservableCollections;
1414
1515 /**
16- *
16+ * HTMLページ上の特定の項目を検索し、その項目内容の値を取得する。
1717 * @author kgto
1818 */
1919 public class Frame1 extends javax.swing.JFrame {
@@ -48,6 +48,9 @@
4848 bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
4949
5050 jFileChooser1 = new javax.swing.JFileChooser();
51+ jLabel1 = new javax.swing.JLabel();
52+ jTxtUrl = new javax.swing.JTextField();
53+ jBtnSearch = new javax.swing.JButton();
5154 jPanel1 = new javax.swing.JPanel();
5255 jScrollPane1 = new javax.swing.JScrollPane();
5356 jTable1 = new javax.swing.JTable();
@@ -54,8 +57,6 @@
5457 jBtnRowIns = new javax.swing.JButton();
5558 jBtnRowDel = new javax.swing.JButton();
5659 jBtnRowCpy = new javax.swing.JButton();
57- jLabel1 = new javax.swing.JLabel();
58- jTxtUrl = new javax.swing.JTextField();
5960 jPanel2 = new javax.swing.JPanel();
6061 jScrollPane2 = new javax.swing.JScrollPane();
6162 jTxtRtn = new javax.swing.JTextArea();
@@ -70,7 +71,17 @@
7071 jFileChooser1.setFileFilter(new FileNameExtensionFilter("TEXTファイル", "txt"));
7172
7273 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
74+ setTitle("タグ検索");
7375
76+ jLabel1.setText(" URL:");
77+
78+ jBtnSearch.setText("検索");
79+ jBtnSearch.addActionListener(new java.awt.event.ActionListener() {
80+ public void actionPerformed(java.awt.event.ActionEvent evt) {
81+ jBtnSearchActionPerformed(evt);
82+ }
83+ });
84+
7485 jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("検索情報"));
7586
7687 jTable1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
@@ -145,8 +156,6 @@
145156 .addComponent(jBtnRowCpy)))
146157 );
147158
148- jLabel1.setText("URL:");
149-
150159 jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("検索結果"));
151160
152161 jTxtRtn.setColumns(20);
@@ -161,7 +170,7 @@
161170 );
162171 jPanel2Layout.setVerticalGroup(
163172 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
164- .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
173+ .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
165174 );
166175
167176 jMenu1.setText("ファイル");
@@ -201,7 +210,9 @@
201210 .addGroup(layout.createSequentialGroup()
202211 .addComponent(jLabel1)
203212 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
204- .addComponent(jTxtUrl))
213+ .addComponent(jTxtUrl)
214+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
215+ .addComponent(jBtnSearch))
205216 .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
206217 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
207218 );
@@ -210,7 +221,8 @@
210221 .addGroup(layout.createSequentialGroup()
211222 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
212223 .addComponent(jLabel1)
213- .addComponent(jTxtUrl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
224+ .addComponent(jTxtUrl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
225+ .addComponent(jBtnSearch))
214226 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
215227 .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
216228 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@@ -279,6 +291,15 @@
279291 }
280292 }//GEN-LAST:event_jBtnRowCpyActionPerformed
281293
294+ private void jBtnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnSearchActionPerformed
295+ jTxtRtn.setText(null);
296+ HtmlParser par = new HtmlParser(jTxtUrl.getText());
297+ for (Object slist1 : slist) {
298+ String rtn = par.search((serachData)slist1);
299+ jTxtRtn.append(rtn + "\r\n");
300+ }
301+ }//GEN-LAST:event_jBtnSearchActionPerformed
302+
282303 /**
283304 * @param args the command line arguments
284305 */
@@ -318,6 +339,7 @@
318339 private javax.swing.JButton jBtnRowCpy;
319340 private javax.swing.JButton jBtnRowDel;
320341 private javax.swing.JButton jBtnRowIns;
342+ private javax.swing.JButton jBtnSearch;
321343 private javax.swing.JFileChooser jFileChooser1;
322344 private javax.swing.JLabel jLabel1;
323345 private javax.swing.JMenu jMenu1;