-1
如果任何標籤已滿,此示例將顯示驗證彈出窗口。我想改變它,以便它只顯示錯誤消息,如果所有的jlabels都已滿。如何檢查jlabel數組已滿?
//check to see if car park is full
void checkFull()
{
for(int i = 0; i < parkingSpace.length; i++)
{
if (parkingSpace[i].getIcon() != null)
{
JOptionPane.showMessageDialog(null, "Sorry the Car Park is full!");
}
}
}