This is how i Add up my buttons, and I've added them into an ArrayList, but I have a hard time reaching a button in the Array list.
for(int i = 0; i < tabChar.length; i++){
JButton btnNewButton = new JButton(String.valueOf(tabChar));
buttons.add(i,btnNewButton);
btnNewButton.setFont(new Font("Arial", Font.PLAIN, 40));
GridBagConstraints gbc_btnNewButton = new GridBagConstraints();
gbc_btnNewButton.insets = new Insets(0, 1, 70, 6);
gbc_btnNewButton.gridx = i;
gbc_btnNewButton.gridy = 0;
gbc_btnNewButton.weightx = 1;
btnNewButton.setPreferredSize(dimension);
btnNewButton.setOpaque(true);
btnNewButton.setBackground(Color.WHITE);
frame.getContentPane().add(btnNewButton, gbc_btnNewButton);
btnNewButton.addMouseListener(new MouseListener() {
Here is where i Would want the mouse drag. For each button, if i use mouse drag and drag it onto another button, they sum up