Tag: 名称

使用Java中的循环创建变量名称?

第一次海报,长时间读者所以对我温柔:) 请参阅以下代码,该代码用于生成财务年度中每月开始和结束的时间戳。 int year = 2010; // Financial year runs from Sept-Aug so earlyMonths are those where year = FY-1 and lateMonths are those where year = FY int[] earlyMonths = {8, 9, 10, 11}; // Sept to Dec int earlyYear = year -1; for (int i : earlyMonths) { month = i; Calendar cal […]

批量生产JTable

我想制作25个JTable。 我通过这样做来生成表名: for(int i=0; i < 26; i++) { TableNames[i] = "Table" + i + ""; … 我怎样才能在数组中使用这些String名称作为新的JTable名称? 即 TableNames[i] = new JTable(model){ …