質問編集履歴

2

記載ミス修正

2017/03/09 04:54

投稿

katare
katare

スコア15

test CHANGED
File without changes
test CHANGED
@@ -14,350 +14,340 @@
14
14
 
15
15
  // CombBoxクラス
16
16
 
17
- public class CmbSyainID {
17
+ public class cmbSyainID {
18
-
18
+
19
- private final SimpleIntegerProperty iSyainID = new SimpleIntegerProperty();
19
+ private final SimpleIntegerProperty iSyainID = new SimpleIntegerProperty();
20
-
20
+
21
- private final SimpleStringProperty sSyainName = new SimpleStringProperty();
21
+ private final SimpleStringProperty sSyainName = new SimpleStringProperty();
22
-
23
-
24
-
22
+
23
+
24
+
25
- public CmbSyainID () {
25
+ public cmbSyainID() {
26
-
26
+
27
- this (0,"");
27
+ this (0,"");
28
+
29
+ }
30
+
31
+ public cmbSyainID (Integer id, String name) {
32
+
33
+ setSyainID(id);
34
+
35
+ setSyainName(name);
36
+
37
+ }
38
+
39
+ // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
40
+
41
+ public Integer getSyainID() {
42
+
43
+ return iSyainID.get();
44
+
45
+ }
46
+
47
+ public void setSyainID(Integer id){
48
+
49
+ iSyainID.set(id);
50
+
51
+ }
52
+
53
+ public String getSyainName() {
54
+
55
+ return sSyainName.get();
56
+
57
+ }
58
+
59
+ public void setSyainName(String name) {
60
+
61
+ sSyainName.set(name);
62
+
63
+ }
64
+
65
+ public void setSelectedItem(Integer id) {
66
+
67
+ iSyainID.set(id);
68
+
69
+ }
70
+
71
+ public Integer getSelectedItem() {
72
+
73
+ return iSyainID.get();
74
+
75
+ }
76
+
77
+ // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
78
+
79
+ public int getValue() {
80
+
81
+ return iSyainID.get();
82
+
83
+ }
84
+
85
+ public void setValue(Integer id) {
86
+
87
+ iSyainID.set(id);
88
+
89
+ }
90
+
91
+ public String getText() {
92
+
93
+ return sSyainName.get();
94
+
95
+ }
96
+
97
+ public void setText(String name) {
98
+
99
+ sSyainName.set(name);
100
+
101
+ }
102
+
103
+ public String toString() {
104
+
105
+ return sSyainName.get();
106
+
107
+ }
108
+
109
+ }
110
+
111
+ // Controllerクラス
112
+
113
+ public class SyainController implements Initializable {
114
+
115
+ @FXML ComboBox<cmbSyainID> cSyainID;
116
+
117
+ @FXML TableView<LstSyain> LstSyain;
118
+
119
+ @FXML TextField tSyainName;
120
+
121
+
122
+
123
+ Integer iBusyoID = 10;
124
+
125
+ PreparedStatement pstmt = null;
126
+
127
+ ResultSet rset = null;
128
+
129
+
130
+
131
+ @Override
132
+
133
+ public void initialize(URL url , ResourceBundle rb) {
134
+
135
+ // * CombBox List
136
+
137
+ // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
138
+
139
+ setSyainList();
140
+
141
+ cSyainID.getSelectionModel().select(0);
142
+
143
+
144
+
145
+ // * TableView List
146
+
147
+ // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
148
+
149
+ LstSyain.getItems().setAll(returnSyainList());
150
+
151
+
152
+
153
+ LstSyain.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<LstSyain> () {
154
+
155
+ @Override
156
+
157
+ public void changed(ObservableValue<? extends LstSyain> value, LstSyain oldValue, LstSyain newValue) {
158
+
159
+ if (LstSyain.getSelectionModel().getSelectedItem() != null) {
160
+
161
+ //getSyainName()は、LstSyainクラスにて宣言
162
+
163
+ tSyainName.setText((String) newValue.getSyainName());
164
+
165
+ // ※※※※※※※※※※※※※※※※※※※※※※※※※※※
166
+
167
+ //Listの動きに伴って、CombBoxの値も変更したい
168
+
169
+ //今回指摘して頂いた ⇒ select(T item) (B)選択すべきアイテムのvalueを指定をしてるつもり
170
+
171
+ cSyainID.getSelectionModel().select(newValue.getSyainID());
172
+
173
+ // ※※※※※※※※※※※※※※※※※※※※※※※※※※※
174
+
175
+ }
28
176
 
29
177
  }
30
178
 
179
+ });
180
+
181
+ }
182
+
183
+ // * CombBox List.
184
+
185
+ //──────────────────────────────
186
+
187
+ public void setSyainList() {
188
+
189
+ String strSQL = "Execute dbo.PStad"
190
+
191
+ + " @NN = 'CBoxSource'"
192
+
193
+ + ", @BusyoID = " + Integer.toString(iBusyoID);
194
+
195
+
196
+
197
+ PreparedStatement pstmt = null;
198
+
199
+ ResultSet rset = null;
200
+
201
+
202
+
203
+ List<cmbSyainID> ll = new LinkedList<cmbSyainID>();
204
+
31
- public CmbSyainID (Integer id, String name) {
205
+ cmbSyainID roww = new cmbSyainID();
206
+
207
+
208
+
32
-
209
+ // ──────────────────────────────
210
+
211
+ try {
212
+
213
+ Connection con = DBConnect.connect(); //DBConnec Connectionクラス
214
+
215
+ pstmt = con.prepareStatement(strSQL);
216
+
217
+ rset = pstmt.executeQuery();
218
+
219
+
220
+
221
+ while (rset.next()) {
222
+
223
+ roww = new cmbSyainID();
224
+
225
+ roww.setSyainID(rset.getInt(1));
226
+
227
+ roww.setSyainName(rset.getString(2));
228
+
229
+ ll.add(roww);
230
+
231
+ }
232
+
33
- setSyainID(id);
233
+ rset.close();
234
+
34
-
235
+ pstmt.close();
236
+
237
+ } catch (Exception e) {
238
+
35
- setSyainName(name);
239
+ e.printStackTrace();
240
+
241
+ }
242
+
243
+ cSyainID.getItems().setAll(ll);
36
244
 
37
245
  }
38
246
 
247
+
248
+
249
+ // * TableView List.
250
+
251
+ //──────────────────────────────
252
+
253
+ private List<LstSyain> returnSyainList() {
254
+
255
+ Integer iID = 100;
256
+
257
+
258
+
259
+ PreparedStatement pstmt = null;
260
+
261
+ ResultSet rset = null;
262
+
263
+ List<LstSyain> ll = new LinkedList<LstSyain>();
264
+
265
+
266
+
267
+ try {
268
+
269
+ Connection cnn = DBConnect.connect();
270
+
271
+ String strSQL = "Execute dbo.PStad"
272
+
273
+ + " @nn = 'ListReturn'"
274
+
275
+ + ", @ID = " + Integer.toString(iID);
276
+
277
+
278
+
279
+ pstmt = cnn.prepareStatement(strSQL);
280
+
281
+ rset = pstmt.executeQuery();
282
+
283
+
284
+
285
+ int i = 0;
286
+
287
+ while (rset.next()) {
288
+
289
+ i = i + 1;
290
+
291
+ //──────────────────────────────
292
+
293
+ Integer id = rset.getInt(1);
294
+
295
+ String name = rset.getString(2);
296
+
297
+
298
+
299
+ //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
300
+
301
+ // 一番上のレコードの値ををコントロールに表示
302
+
303
+ if (i == 1) {
304
+
39
- // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
305
+ //※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
306
+
40
-
307
+ // select(i) indexではなくValueでSelectしたい
308
+
309
+ // cmbCombBox.select(T item)
310
+
311
+ cSyainID.getSelectionModel().select(id);
312
+
313
+ //※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
314
+
315
+ tSyainName.setText(name);
316
+
317
+ }
318
+
319
+ //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
320
+
321
+
322
+
41
- public Integer getSyainID() {
323
+ LstSyain roww = new LstSyain();
42
-
324
+
43
- return iSyainID.get();
325
+ roww.setSyainID(id);
326
+
327
+ roww.setSyainName(name);
328
+
329
+
330
+
331
+ ll.add(roww);
332
+
333
+ }
334
+
335
+ rset.close();
336
+
337
+ pstmt.close();
338
+
339
+ }
340
+
341
+ catch (Exception e) {
342
+
343
+ e.printStackTrace();
344
+
345
+ }
346
+
347
+ return ll;
44
348
 
45
349
  }
46
350
 
47
- public void setSyainID(Integer id){
48
-
49
- iSyainID.set(id);
50
-
51
- }
351
+ }
52
-
53
- public String getSyainName() {
54
-
55
- return sSyainName.get();
56
-
57
- }
58
-
59
- public void setSyainName(String name) {
60
-
61
- sSyainName.set(name);
62
-
63
- }
64
-
65
- public void setSelectedItem(Integer syubetsuid) {
66
-
67
- iSyubetsuID.set(syubetsuid);
68
-
69
- }
70
-
71
- public Integer getSelectedItem() {
72
-
73
- return iSyubetsuID.get();
74
-
75
- }
76
-
77
- // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
78
-
79
- public int getValue() {
80
-
81
- return iSyainID.get();
82
-
83
- }
84
-
85
- public void setValue(Integer id) {
86
-
87
- iSyainID.set(id);
88
-
89
- }
90
-
91
- public String getText() {
92
-
93
- return sSyainName.get();
94
-
95
- }
96
-
97
- public void setText(String name) {
98
-
99
- sSyainName.set(name);
100
-
101
- }
102
-
103
- public String toString() {
104
-
105
- return sSyainName.get();
106
-
107
- }
108
-
109
- }
110
-
111
-
112
-
113
- // Controllerクラス
114
-
115
- public class SyainController implements Initializable {
116
-
117
- @FXML ComboBox<CmbSyainID> cSyainID;
118
-
119
- @FXML TableView<LstSyain> LstSyain;
120
-
121
-
122
-
123
- PreparedStatement pstmt = null;
124
-
125
- ResultSet rset = null;
126
-
127
-
128
-
129
- @Override
130
-
131
- public void initialize(URL url , ResourceBundle rb) {
132
-
133
- // * CombBox List
134
-
135
- // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
136
-
137
- setSyainList();
138
-
139
- cSyainID.getSelectionModel().select(0);
140
-
141
-
142
-
143
- // * TableView List
144
-
145
- // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
146
-
147
- Lstsyain.getItems().setAll(returnSyainList());
148
-
149
-
150
-
151
- Lstsyain.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<LstSyain> () {
152
-
153
- @Override
154
-
155
- public void changed(ObservableValue<? extends LstSyain> value, LstSyain oldValue, LstSyain newValue) {
156
-
157
- if (LstSyain.getSelectionModel().getSelectedItem() != null) {
158
-
159
- //getSyainName()は、LstSyainクラスにて宣言
160
-
161
- tSyainName.setText((String) newValue.getSyainName());
162
-
163
- // ※※※※※※※※※※※※※※※※※※※※※※※※※※※
164
-
165
- //Listの動きに伴って、CombBoxの値も変更したい
166
-
167
- //今回指摘して頂いた ⇒ select(T item) (B)選択すべきアイテムのvalueを指定をしてるつもり
168
-
169
- cSyainID.getSelectionModel().select(newValue.getSyainID());
170
-
171
- // ※※※※※※※※※※※※※※※※※※※※※※※※※※※
172
-
173
- }
174
-
175
- }
176
-
177
- });
178
-
179
- }
180
-
181
-
182
-
183
- // * CombBox List.
184
-
185
- //──────────────────────────────
186
-
187
- public void setSyainList() {
188
-
189
- String strSQL = "Execute dbo.PStad"
190
-
191
- + " @NN = 'CBoxSource'"
192
-
193
- + ", @BusyoID = " + Integer.toString(iBusyoID);
194
-
195
-
196
-
197
- PreparedStatement pstmt = null;
198
-
199
- ResultSet rset = null;
200
-
201
-
202
-
203
- List<CmbSyainID> ll = new LinkedList<CmbSyainID>();
204
-
205
- CmbSyainID roww = new CmbSyainID();
206
-
207
-
208
-
209
- // ──────────────────────────────
210
-
211
- try {
212
-
213
- Connection con = DBConnect.connect(); //DBConnec Connectionクラス
214
-
215
- pstmt = con.prepareStatement(strSQL);
216
-
217
- rset = pstmt.executeQuery();
218
-
219
-
220
-
221
- while (rset.next()) {
222
-
223
- roww = new CmbSyubetsuID();
224
-
225
- roww.setSyainID(rset.getInt(1));
226
-
227
- roww.setSyainName(rset.getString(2));
228
-
229
- ll.add(roww);
230
-
231
- }
232
-
233
- rset.close();
234
-
235
- pstmt.close();
236
-
237
- } catch (Exception e) {
238
-
239
- e.printStackTrace();
240
-
241
- }
242
-
243
- cSyainID.getItems().setAll(ll);
244
-
245
- }
246
-
247
-
248
-
249
- // * TableView List.
250
-
251
- //──────────────────────────────
252
-
253
- private List<Lstsyain> returnSyainList() {
254
-
255
- Integer iID = 100;
256
-
257
-
258
-
259
- PreparedStatement pstmt = null;
260
-
261
- ResultSet rset = null;
262
-
263
- List<LstTableView> ll = new LinkedList<LstTableView>();
264
-
265
-
266
-
267
- // ※初期化
268
-
269
- Lstsyain.setPlaceholder(new Label("表示する内容はありません。"));
270
-
271
- tSyainName.setText("");
272
-
273
- cSyainID.getSelectionModel().select(null);
274
-
275
-
276
-
277
- try {
278
-
279
- Connection cnn = DBConnect.connect();
280
-
281
- String strSQL = "Execute dbo.PStad"
282
-
283
- + " @nn = 'ListReturn'"
284
-
285
- + ", @ID = " + Integer.toString(iID);
286
-
287
-
288
-
289
- pstmt = cnn.prepareStatement(strSQL);
290
-
291
- rset = pstmt.executeQuery();
292
-
293
-
294
-
295
- int i = 0;
296
-
297
- while (rset.next()) {
298
-
299
- i = i + 1;
300
-
301
- //──────────────────────────────
302
-
303
- Integer id = rset.getInt(1);
304
-
305
- String name = rset.getString(2);
306
-
307
-
308
-
309
- //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
310
-
311
- // 一番上のレコードの値ををコントロールに表示
312
-
313
- if (i == 1) {
314
-
315
- tfName.setText(nama);
316
-
317
- //※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
318
-
319
- // select(i) indexではなくValueでSelectしたい
320
-
321
- // cmbCombBox.select(T item)
322
-
323
- cSyainID.getSelectionModel().select(id);
324
-
325
- //※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
326
-
327
- tSyainName.setText(name);
328
-
329
- }
330
-
331
- //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
332
-
333
-
334
-
335
- LstTableViewroww = new LstTableView();
336
-
337
- roww.setID(id);
338
-
339
- roww.setName(nama);
340
-
341
-
342
-
343
- ll.add(roww);
344
-
345
- }
346
-
347
- rset.close();
348
-
349
- pstmt.close();
350
-
351
- }
352
-
353
- catch (Exception e) {
354
-
355
- e.printStackTrace();
356
-
357
- }
358
-
359
- return ll;
360
-
361
- }
362
352
 
363
353
  ```

1

CombBoxのクラス追記および、CombBoxの値を変更したい箇所を追加

2017/03/09 04:54

投稿

katare
katare

スコア15

test CHANGED
File without changes
test CHANGED
@@ -12,12 +12,248 @@
12
12
 
13
13
  ```JavaFX
14
14
 
15
+ // CombBoxクラス
16
+
17
+ public class CmbSyainID {
18
+
19
+ private final SimpleIntegerProperty iSyainID = new SimpleIntegerProperty();
20
+
21
+ private final SimpleStringProperty sSyainName = new SimpleStringProperty();
22
+
23
+
24
+
25
+ public CmbSyainID () {
26
+
27
+ this (0,"");
28
+
29
+ }
30
+
31
+ public CmbSyainID (Integer id, String name) {
32
+
33
+ setSyainID(id);
34
+
35
+ setSyainName(name);
36
+
37
+ }
38
+
39
+ // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
40
+
41
+ public Integer getSyainID() {
42
+
43
+ return iSyainID.get();
44
+
45
+ }
46
+
47
+ public void setSyainID(Integer id){
48
+
49
+ iSyainID.set(id);
50
+
51
+ }
52
+
53
+ public String getSyainName() {
54
+
55
+ return sSyainName.get();
56
+
57
+ }
58
+
59
+ public void setSyainName(String name) {
60
+
61
+ sSyainName.set(name);
62
+
63
+ }
64
+
65
+ public void setSelectedItem(Integer syubetsuid) {
66
+
67
+ iSyubetsuID.set(syubetsuid);
68
+
69
+ }
70
+
71
+ public Integer getSelectedItem() {
72
+
73
+ return iSyubetsuID.get();
74
+
75
+ }
76
+
77
+ // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
78
+
79
+ public int getValue() {
80
+
81
+ return iSyainID.get();
82
+
83
+ }
84
+
85
+ public void setValue(Integer id) {
86
+
87
+ iSyainID.set(id);
88
+
89
+ }
90
+
91
+ public String getText() {
92
+
93
+ return sSyainName.get();
94
+
95
+ }
96
+
97
+ public void setText(String name) {
98
+
99
+ sSyainName.set(name);
100
+
101
+ }
102
+
103
+ public String toString() {
104
+
105
+ return sSyainName.get();
106
+
107
+ }
108
+
109
+ }
110
+
111
+
112
+
113
+ // Controllerクラス
114
+
115
+ public class SyainController implements Initializable {
116
+
117
+ @FXML ComboBox<CmbSyainID> cSyainID;
118
+
119
+ @FXML TableView<LstSyain> LstSyain;
120
+
121
+
122
+
123
+ PreparedStatement pstmt = null;
124
+
125
+ ResultSet rset = null;
126
+
127
+
128
+
129
+ @Override
130
+
131
+ public void initialize(URL url , ResourceBundle rb) {
132
+
133
+ // * CombBox List
134
+
135
+ // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
136
+
137
+ setSyainList();
138
+
139
+ cSyainID.getSelectionModel().select(0);
140
+
141
+
142
+
143
+ // * TableView List
144
+
145
+ // ―――――――――――――――――――――――――――――――――――――――――――――――――――――
146
+
147
+ Lstsyain.getItems().setAll(returnSyainList());
148
+
149
+
150
+
151
+ Lstsyain.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<LstSyain> () {
152
+
153
+ @Override
154
+
155
+ public void changed(ObservableValue<? extends LstSyain> value, LstSyain oldValue, LstSyain newValue) {
156
+
157
+ if (LstSyain.getSelectionModel().getSelectedItem() != null) {
158
+
159
+ //getSyainName()は、LstSyainクラスにて宣言
160
+
161
+ tSyainName.setText((String) newValue.getSyainName());
162
+
163
+ // ※※※※※※※※※※※※※※※※※※※※※※※※※※※
164
+
165
+ //Listの動きに伴って、CombBoxの値も変更したい
166
+
167
+ //今回指摘して頂いた ⇒ select(T item) (B)選択すべきアイテムのvalueを指定をしてるつもり
168
+
169
+ cSyainID.getSelectionModel().select(newValue.getSyainID());
170
+
171
+ // ※※※※※※※※※※※※※※※※※※※※※※※※※※※
172
+
173
+ }
174
+
175
+ }
176
+
177
+ });
178
+
179
+ }
180
+
181
+
182
+
183
+ // * CombBox List.
184
+
185
+ //──────────────────────────────
186
+
187
+ public void setSyainList() {
188
+
189
+ String strSQL = "Execute dbo.PStad"
190
+
191
+ + " @NN = 'CBoxSource'"
192
+
193
+ + ", @BusyoID = " + Integer.toString(iBusyoID);
194
+
195
+
196
+
197
+ PreparedStatement pstmt = null;
198
+
199
+ ResultSet rset = null;
200
+
201
+
202
+
203
+ List<CmbSyainID> ll = new LinkedList<CmbSyainID>();
204
+
205
+ CmbSyainID roww = new CmbSyainID();
206
+
207
+
208
+
209
+ // ──────────────────────────────
210
+
211
+ try {
212
+
213
+ Connection con = DBConnect.connect(); //DBConnec Connectionクラス
214
+
215
+ pstmt = con.prepareStatement(strSQL);
216
+
217
+ rset = pstmt.executeQuery();
218
+
219
+
220
+
221
+ while (rset.next()) {
222
+
223
+ roww = new CmbSyubetsuID();
224
+
225
+ roww.setSyainID(rset.getInt(1));
226
+
227
+ roww.setSyainName(rset.getString(2));
228
+
229
+ ll.add(roww);
230
+
231
+ }
232
+
233
+ rset.close();
234
+
235
+ pstmt.close();
236
+
237
+ } catch (Exception e) {
238
+
239
+ e.printStackTrace();
240
+
241
+ }
242
+
243
+ cSyainID.getItems().setAll(ll);
244
+
245
+ }
246
+
247
+
248
+
249
+ // * TableView List.
250
+
251
+ //──────────────────────────────
252
+
15
- private List<LstTableView> returnTableView() {
253
+ private List<Lstsyain> returnSyainList() {
16
254
 
17
255
  Integer iID = 100;
18
256
 
19
- String sDate = "2017/03/10";
20
-
21
257
 
22
258
 
23
259
  PreparedStatement pstmt = null;
@@ -30,27 +266,23 @@
30
266
 
31
267
  // ※初期化
32
268
 
33
- LstTableView.setPlaceholder(new Label("表示する内容はありません。"));
269
+ Lstsyain.setPlaceholder(new Label("表示する内容はありません。"));
34
-
270
+
35
- tfName.setText("");
271
+ tSyainName.setText("");
36
-
272
+
37
- cmbCombBox.getSelectionModel().select(null);
273
+ cSyainID.getSelectionModel().select(null);
38
-
39
- dtfDay.setValue(DateTimes.toLocalDate(""));
274
+
40
-
41
-
42
-
275
+
276
+
43
- try {
277
+ try {
44
278
 
45
279
  Connection cnn = DBConnect.connect();
46
280
 
47
- String strSQL = "Execute dbo.PStad"
281
+ String strSQL = "Execute dbo.PStad"
48
-
282
+
49
- + " @nn = 'LIstreturn'"
283
+ + " @nn = 'ListReturn'"
50
-
284
+
51
- + ", @ID = " + Integer.toString(iID)
285
+ + ", @ID = " + Integer.toString(iID);
52
-
53
- + ", @Date = '" + sDate + "'";
54
286
 
55
287
 
56
288
 
@@ -66,41 +298,33 @@
66
298
 
67
299
  i = i + 1;
68
300
 
69
- // ──────────────────────────────
301
+ //──────────────────────────────
70
302
 
71
303
  Integer id = rset.getInt(1);
72
304
 
73
- String nama = rset.getString(2);
305
+ String name = rset.getString(2);
74
-
75
- Integer nameid = rset.getInt(3);
76
-
77
- String date = rset.getString(4);
78
306
 
79
307
 
80
308
 
81
309
  //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
310
 
311
+ // 一番上のレコードの値ををコントロールに表示
312
+
83
313
  if (i == 1) {
84
314
 
85
315
  tfName.setText(nama);
86
316
 
87
-
88
-
89
317
  //※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
90
318
 
91
- // select(i) Row_Count()でなくValueでSelectしたい
319
+ // select(i) indexなくValueでSelectしたい
92
-
320
+
93
- // cmbCombBox.setSelectItem(nameid)な感じ
321
+ // cmbCombBox.select(T item)
94
-
322
+
95
- cmbCombBox.getSelectionModel().select(nameid);
323
+ cSyainID.getSelectionModel().select(id);
96
-
97
-
98
324
 
99
325
  //※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
100
326
 
101
-
102
-
103
- dtfKeiyakuDay.setValue(DateTimes.toLocalDate(date));
327
+ tSyainName.setText(name);
104
328
 
105
329
  }
106
330
 
@@ -112,12 +336,8 @@
112
336
 
113
337
  roww.setID(id);
114
338
 
115
- roww.setDay(date);
116
-
117
339
  roww.setName(nama);
118
340
 
119
- roww.setNameID(nameid);
120
-
121
341
 
122
342
 
123
343
  ll.add(roww);