Advertisement
Guest User

Untitled

a guest
May 15th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. JButton AddLootButton = new JButton("Add Item");
  2.         AddLootButton.addActionListener(new ActionListener() {
  3.             public void actionPerformed(ActionEvent arg0) {
  4.                 if(StackableItemButton.isSelected())
  5.                 {
  6.                     for(int i = 0 ; i < LootTable.getRowCount() ; i++ )
  7.                     {
  8.                         if(LootTable.getValueAt(i, 0) == null )
  9.                         {
  10.                             if(LootToAdd != null)
  11.                             {
  12.                                 LootTable.setValueAt(LootToAdd.getText(), i, 0);
  13.                                 LootTable.repaint();
  14.                                 break;
  15.                             }
  16.                            
  17.                         }
  18.                        
  19.                     }
  20.                 }
  21.                 if(NotStackableItemButton.isSelected())
  22.                 {
  23.                     for(int i = 0 ; i < LootTable.getRowCount() ; i++ )
  24.                     {
  25.                         if(LootTable.getValueAt(i, 1) == null )
  26.                         {
  27.                             if(LootToAdd != null)
  28.                             {
  29.                                 LootTable.setValueAt(LootToAdd.getText(), i, 1);
  30.                                 LootTable.repaint();
  31.                                 break;
  32.                             }
  33.                            
  34.                         }
  35.                        
  36.                     }
  37.                 }
  38.                
  39.        
  40.             }
  41.         });
  42.         AddLootButton.setBounds(256, 24, 89, 23);
  43.         panel_14.add(AddLootButton);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement