Buggy code:
public class TableOccupancyMonitorView extends JInternalFrame implements ActionListener { int row ; int column ; JPanel panelOrderSlipView = new JPanel ( ) ; JPanel panelTables = new JPanel ( ) ; JPanel [ ] [ ] panelTable ; JScrollPane scrollPaneTables ; JButton [ ] [ ] buttonOrderSlip ; JButton buttonClean ; BaseTableModel model = new BaseTableModel ( ) ; TableOccupancyMonitorController controller = new TableOccupancyMonitorController ( this ) ; private static TableOccupancyMonitorView INSTANCE ; private TableOccupancyMonitorView ( ) { } private void initComponents ( ) { int tableCount = Integer . parseInt ( controller . countTables ( ) . getValueAt ( 0 , 0 ) . toString ( ) ) ; row = tableCount // 4 ; if ( ( tableCount % 4 ) > 0 ) { ( row ) ++ ; } column = 4 ; panelOrderSlipView . setBorder ( BorderFactory . createMatteBorder ( 1 , 3 , 1 , 1 , Color . gray ) ) ; panelOrderSlipView . setPreferredSize ( new Dimension ( 400 , 0 ) ) ; buttonOrderSlip = new JButton [ row ] [ column ] ; panelTable = new JPanel [ row ] [ column ] ; panelTables . setLayout ( new GridLayout ( row , column , 10 , 10 ) ) ; for ( int i = 0 ; i < ( row ) ; i ++ ) { System . out . println ( ( "row:<seq2seq4repair_space>" + i ) ) ; for ( int j = 0 ; j < ( column ) ; j ++ ) { if ( ( ( i * ( column ) ) + ( j + 1 ) ) <= tableCount ) { System . out . println ( ( "column:<seq2seq4repair_space>" + j ) ) ; buttonOrderSlip [ i ] [ j ] = new JButton ( controller . refresh ( ) . getValueAt ( ( ( i * ( column ) ) + j ) , 1 ) . toString ( ) ) ; buttonOrderSlip [ i ] [ j ] . setBackground ( determineTableColor ( i , j ) ) ; buttonOrderSlip [ i ] [ j ] . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent e ) { System . out . println ( "I<seq2seq4repair_space>Came<seq2seq4repair_space>I<seq2seq4repair_space>Saw<seq2seq4repair_space>I<seq2seq4repair_space>Conquered" ) ; Object [ ] [ ] data = new Object [ ] [ ] { new Object [ ] { "foo" , "baz" } , new Object [ ] { "bar" , "qux" } } ; String [ ] columnNames = new String [ ] { "foobar" , "bazbar" } ; JTable table = new JTable ( data , columnNames ) ; panelOrderSlipView . removeAll ( ) ; panelOrderSlipView . add ( table ) ; panelOrderSlipView . revalidate ( ) ; panelOrderSlipView . repaint ( ) ; } } ) ; buttonClean = new JButton ( "Clean<seq2seq4repair_space>Table" ) ; buttonClean . addActionListener ( ( ( ActionListener ) ( this ) ) ) ; <START_BUG> buttonClean . setActionCommand ( ( "" + ( ( i * ( column ) ) + ( j + 1 ) ) ) ) ; <END_BUG> panelTable [ i ] [ j ] = new JPanel ( ) ; panelTable [ i ] [ j ] . setLayout ( new BorderLayout ( 0 , 0 ) ) ; panelTable [ i ] [ j ] . setPreferredSize ( new Dimension ( 150 , 150 ) ) ; panelTable [ i ] [ j ] . add ( buttonOrderSlip [ i ] [ j ] , BorderLayout . CENTER ) ; panelTable [ i ] [ j ] . add ( buttonClean , BorderLayout . SOUTH ) ; panelTables . add ( panelTable [ i ] [ j ] ) ; } else { JLabel labelBlank = new JLabel ( ) ; panelTables . add ( labelBlank ) ; } } } scrollPaneTables = new JScrollPane ( panelTables ) ; setLayout ( new BorderLayout ( ) ) ; add ( scrollPaneTables , BorderLayout . CENTER ) ; add ( panelOrderSlipView , BorderLayout . EAST ) ; setResizable ( false ) ; setVisible ( true ) ; } public void actionPerformed ( ActionEvent ae ) { } public Color determineTableColor ( int row , int column ) { } public void updateChefView ( ) { } public static TableOccupancyMonitorView getInstance ( ) { } No newline ; at end ; of file ; }

Fix:
buttonClean . setActionCommand ( controller . refresh ( ) . getValueAt ( ( ( i * ( column ) ) + j ) , 1 ) . toString ( ) ) ;