The problem is two JPanels added to a JFrame, within 1 JPanel(newTop) it has a JLabel and the other JPanel(newPanel) has a Jbutton.
I want to click a button in one panel and update the label in the other.. Any ideas
public class Gui
{
public Gui()
{
JFrame newFrame = new JFrame("Test")...
I Have array of JButtons if a 8x8 grid I want to click a button and change the icon of another in the grid (not the one clicked), I dont seem to be able to access the array outside the mouse listener.
class test
{
//cant access this why?
private JButton but[] = new JButton[64];
private class...
This is the code
private class MyMouseAdapter extends MouseAdapter
{
MyMouseAdapter (){}
public void mouseClicked(MouseEvent event)
{
if(event.isMetaDown())
{
JOptionPane.showMessageDialog(null,"RIGHT");
}
else
{...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.