0

i want ot make a 2-dimensional array of JToggleButtons to store toggle button names but i cant figure out the snytax Please Help!

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by slayer10
0
JToggleButton[][] buttons = new JToggleButton[5][5];

That just declares the type and dimensions. You still have to set each element equal to a new instance of JToggleButton.

0

that doesnt work i get a cannot find symbol error

G:\Chess Game\src\chessgame\frmChessBoard.java:15: cannot find symbol
symbol : class JToggleButton
location: class chessgame.frmChessBoard
JToggleButton[][] buttons = new JToggleButton[8][8];
G:\Chess Game\src\chessgame\frmChessBoard.java:15: cannot find symbol
symbol : class JToggleButton
location: class chessgame.frmChessBoard
JToggleButton[][] buttons = new JToggleButton[8][8];
2 errors

0

never mind i gottai mport import javax.swing.JToggleButton;

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.