• 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

Revision27 (tree)
Time2014-06-21 13:00:03
Authortuna_p

Log Message

(empty log message)

Change Summary

Incremental Difference

--- HtmlTest2/src/test1/Frame1.java (revision 26)
+++ HtmlTest2/src/test1/Frame1.java (revision 27)
@@ -9,7 +9,6 @@
99 import java.io.File;
1010 import java.util.*;
1111 import javax.swing.JFileChooser;
12-import javax.swing.filechooser.FileFilter;
1312 import javax.swing.filechooser.FileNameExtensionFilter;
1413 import org.jdesktop.observablecollections.ObservableCollections;
1514
@@ -49,12 +48,16 @@
4948 bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
5049
5150 jFileChooser1 = new javax.swing.JFileChooser();
51+ jPanel1 = new javax.swing.JPanel();
5252 jScrollPane1 = new javax.swing.JScrollPane();
5353 jTable1 = new javax.swing.JTable();
54- jButton1 = new javax.swing.JButton();
55- jButton2 = new javax.swing.JButton();
56- jBtnSave = new javax.swing.JButton();
57- jBtnLoad = new javax.swing.JButton();
54+ jBtnRowIns = new javax.swing.JButton();
55+ jBtnRowDel = new javax.swing.JButton();
56+ jMenuBar1 = new javax.swing.JMenuBar();
57+ jMenu1 = new javax.swing.JMenu();
58+ jMenuLoad = new javax.swing.JMenuItem();
59+ jMenuSave = new javax.swing.JMenuItem();
60+ jMenu2 = new javax.swing.JMenu();
5861
5962 jFileChooser1.setCurrentDirectory(new java.io.File("C:\\zz_work\\java"));
6063 jFileChooser1.setDialogTitle("");
@@ -89,66 +92,82 @@
8992 jTableBinding.bind();
9093 jScrollPane1.setViewportView(jTable1);
9194
92- jButton1.setText("jButton1");
93- jButton1.addActionListener(new java.awt.event.ActionListener() {
95+ jBtnRowIns.setText("行追加");
96+ jBtnRowIns.addActionListener(new java.awt.event.ActionListener() {
9497 public void actionPerformed(java.awt.event.ActionEvent evt) {
95- jButton1ActionPerformed(evt);
98+ jBtnRowInsActionPerformed(evt);
9699 }
97100 });
98101
99- jButton2.setText("jButton2");
100- jButton2.addActionListener(new java.awt.event.ActionListener() {
102+ jBtnRowDel.setText("行削除");
103+ jBtnRowDel.addActionListener(new java.awt.event.ActionListener() {
101104 public void actionPerformed(java.awt.event.ActionEvent evt) {
102- jButton2ActionPerformed(evt);
105+ jBtnRowDelActionPerformed(evt);
103106 }
104107 });
105108
106- jBtnSave.setText("SAVE");
107- jBtnSave.addActionListener(new java.awt.event.ActionListener() {
109+ javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
110+ jPanel1.setLayout(jPanel1Layout);
111+ jPanel1Layout.setHorizontalGroup(
112+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
113+ .addGroup(jPanel1Layout.createSequentialGroup()
114+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
115+ .addGroup(jPanel1Layout.createSequentialGroup()
116+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
117+ .addComponent(jBtnRowDel)
118+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
119+ .addComponent(jBtnRowIns))
120+ .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE))
121+ .addGap(0, 0, Short.MAX_VALUE))
122+ );
123+ jPanel1Layout.setVerticalGroup(
124+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
125+ .addGroup(jPanel1Layout.createSequentialGroup()
126+ .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
127+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
128+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
129+ .addComponent(jBtnRowDel)
130+ .addComponent(jBtnRowIns)))
131+ );
132+
133+ jMenu1.setText("ファイル");
134+
135+ jMenuLoad.setText("LOAD");
136+ jMenuLoad.addActionListener(new java.awt.event.ActionListener() {
108137 public void actionPerformed(java.awt.event.ActionEvent evt) {
109- jBtnSaveActionPerformed(evt);
138+ jMenuLoadActionPerformed(evt);
110139 }
111140 });
141+ jMenu1.add(jMenuLoad);
112142
113- jBtnLoad.setText("LOAD");
114- jBtnLoad.addActionListener(new java.awt.event.ActionListener() {
143+ jMenuSave.setText("SAVE");
144+ jMenuSave.addActionListener(new java.awt.event.ActionListener() {
115145 public void actionPerformed(java.awt.event.ActionEvent evt) {
116- jBtnLoadActionPerformed(evt);
146+ jMenuSaveActionPerformed(evt);
117147 }
118148 });
149+ jMenu1.add(jMenuSave);
119150
151+ jMenuBar1.add(jMenu1);
152+
153+ jMenu2.setText("Edit");
154+ jMenuBar1.add(jMenu2);
155+
156+ setJMenuBar(jMenuBar1);
157+
120158 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
121159 getContentPane().setLayout(layout);
122160 layout.setHorizontalGroup(
123161 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
124162 .addGroup(layout.createSequentialGroup()
125- .addContainerGap()
126- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
127- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
128- .addGap(0, 1, Short.MAX_VALUE)
129- .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE))
130- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
131- .addComponent(jBtnSave)
132- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
133- .addComponent(jBtnLoad)
134- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
135- .addComponent(jButton2)
136- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
137- .addComponent(jButton1)))
138- .addContainerGap())
163+ .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
164+ .addGap(0, 10, Short.MAX_VALUE))
139165 );
140166 layout.setVerticalGroup(
141167 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
142168 .addGroup(layout.createSequentialGroup()
143- .addContainerGap()
144- .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
145- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
146- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
147- .addComponent(jButton1)
148- .addComponent(jButton2)
149- .addComponent(jBtnSave)
150- .addComponent(jBtnLoad))
151- .addContainerGap())
169+ .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
170+ .addGap(0, 30, Short.MAX_VALUE))
152171 );
153172
154173 bindingGroup.bind();
@@ -156,7 +175,7 @@
156175 pack();
157176 }// </editor-fold>//GEN-END:initComponents
158177
159- private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
178+ private void jBtnRowInsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnRowInsActionPerformed
160179 serachData sdat = new serachData();
161180 sdat.setitem("項目1");
162181 sdat.setHtmltag("DIV");
@@ -165,32 +184,32 @@
165184 sdat.setaround("");
166185 sdat.setregexp("");
167186 this.serachDataList.add(sdat);
168- }//GEN-LAST:event_jButton1ActionPerformed
187+ }//GEN-LAST:event_jBtnRowInsActionPerformed
169188
170- private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
189+ private void jBtnRowDelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnRowDelActionPerformed
171190 //System.out.println(jTable1.getSelectedRow());
172191 int SelectedRow = jTable1.getSelectedRow();
173192 if(!(SelectedRow < 0)) {
174193 this.serachDataList.remove(SelectedRow);
175194 }
176- }//GEN-LAST:event_jButton2ActionPerformed
195+ }//GEN-LAST:event_jBtnRowDelActionPerformed
177196
178- private void jBtnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnSaveActionPerformed
179- int selected = jFileChooser1.showSaveDialog(this);
197+ private void jMenuLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuLoadActionPerformed
198+ int selected = jFileChooser1.showOpenDialog(this);
180199 if (selected == JFileChooser.APPROVE_OPTION) {
181200 File file = jFileChooser1.getSelectedFile();
182- sio.save(file, slist);
201+ serachDataList.clear();
202+ serachDataList.addAll(sio.load(file));
183203 }
184- }//GEN-LAST:event_jBtnSaveActionPerformed
204+ }//GEN-LAST:event_jMenuLoadActionPerformed
185205
186- private void jBtnLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnLoadActionPerformed
187- int selected = jFileChooser1.showOpenDialog(this);
206+ private void jMenuSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuSaveActionPerformed
207+ int selected = jFileChooser1.showSaveDialog(this);
188208 if (selected == JFileChooser.APPROVE_OPTION) {
189209 File file = jFileChooser1.getSelectedFile();
190- serachDataList.clear();
191- serachDataList.addAll(sio.load(file));
210+ sio.save(file, slist);
192211 }
193- }//GEN-LAST:event_jBtnLoadActionPerformed
212+ }//GEN-LAST:event_jMenuSaveActionPerformed
194213
195214 /**
196215 * @param args the command line arguments
@@ -228,11 +247,15 @@
228247 }
229248
230249 // Variables declaration - do not modify//GEN-BEGIN:variables
231- private javax.swing.JButton jBtnLoad;
232- private javax.swing.JButton jBtnSave;
233- private javax.swing.JButton jButton1;
234- private javax.swing.JButton jButton2;
250+ private javax.swing.JButton jBtnRowDel;
251+ private javax.swing.JButton jBtnRowIns;
235252 private javax.swing.JFileChooser jFileChooser1;
253+ private javax.swing.JMenu jMenu1;
254+ private javax.swing.JMenu jMenu2;
255+ private javax.swing.JMenuBar jMenuBar1;
256+ private javax.swing.JMenuItem jMenuLoad;
257+ private javax.swing.JMenuItem jMenuSave;
258+ private javax.swing.JPanel jPanel1;
236259 private javax.swing.JScrollPane jScrollPane1;
237260 private javax.swing.JTable jTable1;
238261 private org.jdesktop.beansbinding.BindingGroup bindingGroup;