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");
guiTop newTop = new guiTop();
guiPanel newPanel = new guiPanel();
BorderLayout BorderFrame= new BorderLayout();
newFrame.setSize(500,500);
newFrame.setLayout(BorderFrame);
newFrame.add(newTop,BorderLayout.NORTH);
newFrame.add(newPanel,BorderLayout.CENTER);
newFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
newFrame.setVisible(true);
}
}
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");
guiTop newTop = new guiTop();
guiPanel newPanel = new guiPanel();
BorderLayout BorderFrame= new BorderLayout();
newFrame.setSize(500,500);
newFrame.setLayout(BorderFrame);
newFrame.add(newTop,BorderLayout.NORTH);
newFrame.add(newPanel,BorderLayout.CENTER);
newFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
newFrame.setVisible(true);
}
}