Alright, I managed to get the border removed by adding 2 lines, so the array aspect looks like this:
for (int i = 0 ; i < total ; i++)
{
//Set-up the starting game of Othello
a [i] = new JButton (createImageIcon ("images\\blank.gif"));
//Since 0, 27 is the 28th space in the board
a [27] = new JButton (createImageIcon ("images\\white.gif"));
a [28] = new JButton (createImageIcon ("images\\black.gif"));
a [35] = new JButton (createImageIcon ("images\\black.gif"));
a [36] = new JButton (createImageIcon ("images\\white.gif"));
a [i].addActionListener (this);
a [i].setActionCommand ("" + i);
a [i].setBackground (Color.black);
a [i].setForeground (Color.black);
//Remove space between buttons and images in button (margin)
a [i].setMargin (new Insets (0, 0, 0, 0));
//Further removes button aspect of images
a [i].setBorder (null);
board.add (a [i]);
}
I added the two lines bold.
Next question is how would I implement two listeners.
I need the
public class Othello extends Applet implements ActionListener
which is just below my libraries. But I also want to be able to use the MouseListener. So, I'm having trouble implementing both listeners.
(additional untaught concepts is good).
I tried:
public class Othello extends Applet implements ActionListener MouseListener
1.
public class Othello extends Applet implements ActionListener implements MouseListener
The reason I need the MouseListener is because I may want it such that one a user is over a certain part of the array, a hint shows. Or maybe, I want it so that (since my game is Othello, aka Reversi), such that when the user's mouse is over a possible move, the image changes. Regardless, I need the MouseListener and the ActionListener (that's a must).
Thank you.