回答編集履歴

1

オリジナルのコンボボックスのリスナは意図したものでは無かったようなので普通(?)に修正

2021/07/22 13:56

投稿

jimbe
jimbe

スコア13168

test CHANGED
@@ -306,25 +306,21 @@
306
306
 
307
307
  JComboBox<String> buyinCombo = new JComboBox<String>(buyin);
308
308
 
309
- buyinCombo.addItemListener(new ItemListener() {
309
+ buyinCombo.addActionListener(new ActionListener() {
310
310
 
311
311
  @Override
312
312
 
313
- public void itemStateChanged(ItemEvent e) {
313
+ public void actionPerformed(ActionEvent e) {
314
-
315
- if (e.getStateChange() == 1) {
314
+
316
-
317
- String str = ((String)buyinCombo.getSelectedItem()).replace("$", "");
315
+ String str = ((String)buyinCombo.getSelectedItem()).replace("$", "");
318
-
316
+
319
- int v = Integer.parseInt(str);
317
+ int v = Integer.parseInt(str);
320
-
318
+
321
- if(buyinListener != null && v != stack) {
319
+ if(buyinListener != null && v != stack) {
322
-
320
+
323
- stack = v;
321
+ stack = v;
324
-
322
+
325
- buyinListener.changeBuyin(stack);
323
+ buyinListener.changeBuyin(stack);
326
-
327
- }
328
324
 
329
325
  }
330
326