Advertisement
Cnvmendoza

MainMenu Relevant Parts

Jun 10th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.43 KB | None | 0 0
  1.  
  2. ...
  3. //Trade Goods Definition
  4.         for (int i = 0; i < baseGoodsPrice.length; i++) {
  5.             //id, price, qty
  6.             tradeGoods[i] = new TradeGoods(i, baseGoodsPrice[i], 0);
  7.         }
  8.            
  9.         setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  10.         //Inventory Settings
  11.         //Line Border
  12.         invPanel.setBorder(BorderFactory.createLineBorder(null));
  13.         //Inventory Label
  14.         invLabel.setText("Inventory");
  15.         //Inventory Table
  16.         invTable.setModel(new DefaultTableModel(
  17.             new Object [][] {
  18.                 {tradeGoods[0].getQty(), industries[0]},
  19.                 {tradeGoods[1].getQty(), industries[1]},
  20.                 {tradeGoods[2].getQty(), industries[2]},
  21.                 {tradeGoods[3].getQty(), industries[3]},
  22.                 {tradeGoods[4].getQty(), industries[4]},
  23.                 {tradeGoods[5].getQty(), industries[5]},
  24.                 {tradeGoods[6].getQty(), industries[6]},
  25.                 {tradeGoods[7].getQty(), industries[7]},
  26.                 {tradeGoods[8].getQty(), industries[8]}
  27.             },
  28.             new String [] {
  29.                 "Quantity", "Goods"
  30.             }
  31.         ) {
  32.             boolean[] canEdit = new boolean [] {
  33.                 false, false
  34.             };
  35.  
  36.             public boolean isCellEditable(int rowIndex, int columnIndex) {
  37.                 return canEdit [columnIndex];
  38.             }
  39.         });
  40. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement