Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Netbeans GUI

807598Jun 4 2006 — edited Jun 4 2006
Hi,
I'm making a battleship program. I made the entire GUI in Netbeans because I was told it would be easier. It was really easy, I set the format to null and then placed all the buttons I wanted, ect. That class is called NewJPanel. Now what I need to do is in the other class access those buttons, I have no idea how to do that. My gui is attached. I need to be able to access the grids and figure out which button is being pressed. So When Jbutton 1 is pressed I know that it is row1, column1, so I can then check my 2d array to see if there is a ship there or not, and then perform the appropriate actions. I don't know how to figure out which JButton is being pressed. I believe I can figure out the radio buttons if you guys will explain the JButtons to me. Thank you very much.

GUI: http://s12.quicksharing.com/v/8822793/NewJPanel.zip.html
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 2 2006
Added on Jun 4 2006
2 comments
96 views