java - Move icon from jbutton to jbutton -


I set up a gridlate with 16 buttons in the center. I had placed an icon on the first button.

How do I loop, and when the user selects the next button on the grid, will this icon move from old location to new position?

  Private Arrestists & lt; Jebton & gt; Grid = new arreelist & lt; Jebton & gt; (); JPNEL grid BtnPanel = new zpn (); GridBtnPanel.setLayout (new grid layout (4, 4)); For (Int i = 0; I   

Any help would be great.

Thank you.

You can add an action list to the button, and after pressing a button, a button without any All buttons are searched to find an empty icon, and pressing the button on the button without any empty icon

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

Simple file compression in C -

php - Sorting an multidimension array using usort fails -