gpt4 book ai didi

java swing ui 不显示重建的数组索引越界

转载 作者:行者123 更新时间:2023-12-01 12:58:09 24 4
gpt4 key购买 nike

好吧,我仍然是一个 Java 新手。说实话,这是一份家庭作业,但我现在正在用头撞墙。我不知道从这里该去哪里。

我正在为作业编写一个库存程序,它必须使用普通数组。不是 ArrayList

我感到困惑的部分是您必须向数组添加新条目的部分。我通过使用 Arrays.copyof 创建它的第二个版本,然后将其重新复制到具有增强长度的原始版本来实现。它似乎有效,通过控制台我可以毫无问题地打印我的新数组,并完成新条目。我遇到的问题是我的 gui 的问题。每次我尝试在我的 gui 中显示新条目时,我都会得到

"Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 5"

我确信我犯了一些愚蠢的错误,但我已经度过了漫长的一天,我完全被这个问题难住了。

package inventoryprogram3;
public class Inventoryprogram3 {


public static void main(String[] args) {
inventoryGui gui = new inventoryGui();
gui.setVisible(true);
}
}
package inventoryprogram3;

import java.io.Serializable;

class sItem implements Serializable{
int itemNumber;
String itemName;
int itemStock;
double itemPrice;
double stockTotal;
public sItem(int iNumber, String iName, int iStock, double iPrice){
itemNumber = iNumber;
itemName = iName;
itemStock = iStock;
itemPrice = iPrice;
}
}

public class rBook extends sItem {
int pCount;
double rFee;
public rBook(int iNumber, String iName, int iStock, double iPrice, int pageCount) {
super(iNumber, iName, iStock, iPrice);
pCount = pageCount;
rFee = (iPrice * iStock) * 1.05;
}
}


package inventoryprogram3;


import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.NumberFormat;
import java.util.Arrays;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;


public class inventoryGui extends javax.swing.JFrame {

/**
* Creates new form inventoryGui
*/
static int max = 5;
static rBook[] rpg = new rBook[max];
double invValue;
int counter = -1;



public inventoryGui() {
initComponents();
rpg[0] = new rBook(1, "Mutants & Masterminds", 4, 19.99, 200);
rpg[1] = new rBook(2, "Exalted", 6, 25.99, 542);
rpg[2] = new rBook(3, "D&D Next", 15, 49.95, 350);
rpg[3] = new rBook(4, "Eclipse Phase", 3, 28.99, 426);
rpg[4] = new rBook(5, "The Mutant Epoch", 8, 19.99, 386);
}



private void initComponents() {

jLabel4 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
nameLabel = new javax.swing.JLabel();
titleLabel = new javax.swing.JLabel();
iNumberLabel = new javax.swing.JLabel();
priceLabel = new javax.swing.JLabel();
pCountlabel = new javax.swing.JLabel();
stockLabel = new javax.swing.JLabel();
restockLabel = new javax.swing.JLabel();
entireInventoryLabel = new javax.swing.JLabel();
restockField = new javax.swing.JTextField();
stockField = new javax.swing.JTextField();
pCountField = new javax.swing.JTextField();
priceField = new javax.swing.JTextField();
iNumberField = new javax.swing.JTextField();
titleField = new javax.swing.JTextField();
inventoryValueLabel = new javax.swing.JLabel();
inventoryValueField = new javax.swing.JTextField();
nextButton = new javax.swing.JButton();
entireInventoryField = new javax.swing.JTextField();
buttonLabel = new javax.swing.JLabel();
previousButton = new javax.swing.JButton();
companyLogo = new javax.swing.JLabel();
saveButton = new javax.swing.JButton();
loadButton = new javax.swing.JButton();
addbutton = new javax.swing.JButton();
deleteButton = new javax.swing.JButton();
modifyButton = new javax.swing.JButton();
searchButton = new javax.swing.JButton();

jLabel4.setText("jLabel4");

jLabel2.setText("jLabel2");

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("RPG Inventory Program v0.4");

nameLabel.setText("Role Playing Game Inventory");

titleLabel.setText("Title");

iNumberLabel.setText("Item Number");

priceLabel.setText("Price");

pCountlabel.setText("Page Count");

stockLabel.setText("Copies in Stock");

restockLabel.setText("Restocking Fee");

entireInventoryLabel.setText("Value of Entire Inventory");

restockField.setEditable(false);

iNumberField.setEditable(false);

inventoryValueLabel.setText("Inventory Value");

nextButton.setText("Next");
nextButton.setToolTipText("Click toDisplay Next Item");
nextButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
nextButtonActionPerformed(evt);
}
});

entireInventoryField.setEditable(false);

buttonLabel.setText("Item Display");

previousButton.setText("Previous");
previousButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
previousButtonActionPerformed(evt);
}
});

companyLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/inventoryprogram3/logo4.png")));

saveButton.setText("Save");
saveButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveButtonActionPerformed(evt);
}
});

loadButton.setText("Clear");
loadButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
loadButtonActionPerformed(evt);
}
});

addbutton.setText("Add");
addbutton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addbuttonActionPerformed(evt);
}
});

deleteButton.setText("Delete");
deleteButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
deleteButtonActionPerformed(evt);
}
});

modifyButton.setText("Modify Current Item");
modifyButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
modifyButtonActionPerformed(evt);
}
});

searchButton.setText("Search");

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(pCountlabel)
.addGap(18, 18, 18)
.addComponent(pCountField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(entireInventoryLabel))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(restockLabel)
.addGap(192, 192, 192)
.addComponent(previousButton))
.addGroup(layout.createSequentialGroup()
.addComponent(loadButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(addbutton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(deleteButton)
.addGap(18, 18, 18)
.addComponent(modifyButton)
.addGap(12, 12, 12)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(nextButton)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(saveButton))))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(nameLabel)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(priceLabel)
.addGap(18, 18, 18)
.addComponent(priceField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(titleLabel)
.addGap(18, 18, 18)
.addComponent(titleField, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(iNumberLabel)
.addGap(18, 18, 18)
.addComponent(iNumberField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(searchButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(companyLogo)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(restockField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(inventoryValueLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(inventoryValueField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(stockLabel)
.addGap(18, 18, 18)
.addComponent(stockField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(entireInventoryField, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(buttonLabel)
.addGap(15, 15, 15)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);

layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {iNumberLabel, pCountlabel, priceLabel, restockLabel, stockLabel, titleLabel});

layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {iNumberField, inventoryValueField, pCountField, priceField, restockField, stockField, titleField});

layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(nameLabel)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(titleLabel)
.addComponent(titleField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(searchButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(iNumberLabel)
.addComponent(iNumberField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(priceLabel)
.addComponent(priceField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(companyLogo, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(pCountlabel)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(pCountField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(entireInventoryLabel)))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(stockLabel)
.addComponent(stockField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(entireInventoryField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(inventoryValueLabel)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(inventoryValueField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonLabel)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(restockLabel)
.addComponent(restockField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(previousButton)
.addComponent(nextButton))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(saveButton)
.addComponent(addbutton)
.addComponent(deleteButton)
.addComponent(modifyButton)
.addComponent(loadButton))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

pack();
}

private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) {


if(counter< max -1){
counter = counter + 1;
}
else{
counter = 0;
}
NumberFormat realMoney = NumberFormat.getCurrencyInstance(Locale.US);
invValue = 0;
for (int x=0; x < max -1; x++) {

invValue += rpg[x].itemStock * rpg[x].itemPrice;

}


System.out.println(counter);
titleField.setText(rpg[counter].itemName);
iNumberField.setText(String.valueOf(rpg[counter].itemNumber));
pCountField.setText(String.valueOf(rpg[counter].pCount));
priceField.setText(String.valueOf(realMoney.format(rpg[counter].itemPrice)));
stockField.setText(String.valueOf(rpg[counter].itemStock));
restockField.setText(String.valueOf(rpg[counter].rFee));
inventoryValueField.setText(String.valueOf(rpg[counter].itemStock * rpg[counter].itemPrice));


entireInventoryField.setText(String.valueOf(realMoney.format(invValue)));

}

private void previousButtonActionPerformed(java.awt.event.ActionEvent evt) {
if(counter>= 1){
counter = counter - 1;
}
else{
counter = max -1;
}
NumberFormat realMoney = NumberFormat.getCurrencyInstance(Locale.US);
invValue = 0;
for (int x=0; x < max -1; x++) {

invValue += rpg[x].itemStock * rpg[x].itemPrice;

}



titleField.setText(rpg[counter].itemName);
iNumberField.setText(String.valueOf(rpg[counter].itemNumber));
pCountField.setText(String.valueOf(rpg[counter].pCount));
priceField.setText(String.valueOf(realMoney.format(rpg[counter].itemPrice)));
stockField.setText(String.valueOf(rpg[counter].itemStock));
restockField.setText(String.valueOf(rpg[counter].rFee));
inventoryValueField.setText(String.valueOf(rpg[counter].itemStock * rpg[counter].itemPrice));


entireInventoryField.setText(String.valueOf(realMoney.format(invValue)));
}

private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {
ObjectOutputStream savefile = null;
int dirmake = 1;
do{
try {
savefile = new ObjectOutputStream(new FileOutputStream("C:\\inventory\\inventory.dat"));
savefile.writeObject(rpg);
savefile.close();
dirmake = 2 ;
}
catch (Exception e){
String savePath = "c:\\Inventory";
Path invPath = Paths.get(savePath);
try {
Files.createDirectory(invPath);
} catch (IOException ex) {
Logger.getLogger(inventoryGui.class.getName()).log(Level.SEVERE, null, ex);
}

}
}while(dirmake == 1);
}

private void loadButtonActionPerformed(java.awt.event.ActionEvent evt) {

titleField.setText("");
iNumberField.setText("");
pCountField.setText("");
priceField.setText("");
stockField.setText("");
restockField.setText("");
inventoryValueField.setText("" );


entireInventoryField.setText("");

}

private void modifyButtonActionPerformed(java.awt.event.ActionEvent evt) {

int mINumber = Integer.parseInt(iNumberField.getText());
double ss = Double.parseDouble(priceField.getText().replaceAll("[^\\d.]", ""));
rpg[mINumber -1] = new rBook(mINumber, titleField.getText(), Integer.parseInt(stockField.getText()), ss, Integer.parseInt(pCountField.getText()));

}

private void addbuttonActionPerformed(java.awt.event.ActionEvent evt) {
double ss = Double.parseDouble(priceField.getText().replaceAll("[^\\d.]", ""));
max ++;
rBook[] rpg2 = Arrays.copyOf(rpg, rpg.length);
rBook[] rpg = Arrays.copyOf(rpg2, max);
rpg[max -1] = new rBook(max, titleField.getText(), Integer.parseInt(stockField.getText()), ss, Integer.parseInt(pCountField.getText()));
System.out.println(max + titleField.getText() + Integer.parseInt(stockField.getText()) + ss + Integer.parseInt(pCountField.getText()));
counter = -1;
System.out.println(max);
for (int x=0; x< max; x++) {
System.out.println("Item Number:" + rpg[5].itemNumber);
System.out.println("Rpg Name:" + rpg[5].itemName);
System.out.println("Copies in stock:" + rpg[5].itemStock);
System.out.println("Price: $" + (rpg[5].itemPrice));
System.out.println("Page Count:" + rpg[5].pCount);
System.out.println("Restocking fee: $" + (rpg[5].rFee));
System.out.println();
System.out.println();
System.out.println(rpg.length);
}

}

private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {


}



public static void main(String args[]) {


try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(inventoryGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(inventoryGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(inventoryGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(inventoryGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new inventoryGui().setVisible(true);


}
});
}


// Variables declaration - do not modify
private javax.swing.JButton addbutton;
private javax.swing.JLabel buttonLabel;
private javax.swing.JLabel companyLogo;
private javax.swing.JButton deleteButton;
private javax.swing.JTextField entireInventoryField;
private javax.swing.JLabel entireInventoryLabel;
private javax.swing.JTextField iNumberField;
private javax.swing.JLabel iNumberLabel;
private javax.swing.JTextField inventoryValueField;
private javax.swing.JLabel inventoryValueLabel;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel4;
private javax.swing.JButton loadButton;
private javax.swing.JButton modifyButton;
private javax.swing.JLabel nameLabel;
private javax.swing.JButton nextButton;
private javax.swing.JTextField pCountField;
private javax.swing.JLabel pCountlabel;
private javax.swing.JButton previousButton;
private javax.swing.JTextField priceField;
private javax.swing.JLabel priceLabel;
private javax.swing.JTextField restockField;
private javax.swing.JLabel restockLabel;
private javax.swing.JButton saveButton;
private javax.swing.JButton searchButton;
private javax.swing.JTextField stockField;
private javax.swing.JLabel stockLabel;
private javax.swing.JTextField titleField;
private javax.swing.JLabel titleLabel;

}

最佳答案

你的问题的一部分是,你正在隐藏你的变量......

max ++;
rBook[] rpg2 = Arrays.copyOf(rpg, rpg.length);
rBook[] rpg = Arrays.copyOf(rpg2, max);

在这里,您已将 rpg 声明为局部变量,因此您对其所做的任何更改都不会被类的其余部分看到。尝试使用更像...的东西

rpg = Arrays.copyOf(rpg2, max);

相反...

您还可以考虑使用System.arraycopy(Object src, int srcPos, Object dest, int destPos, int length)相反...但我会先解决你其他问题;)

rBook[] rpg2 = new rBook[rpg.length + 1];
System.arraycopy(rpg, 0, rpg2, 0, rpg.length - 1);
rpg = rpg2;

或者类似的东西......

关于java swing ui 不显示重建的数组索引越界,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23729029/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com