I have little idea how your code looks like because you didn't show any, but here is an example of how to edit a JLabel
when an action is taken (in this case - pressing a button). The layout of the components on panels does not matter, but I put 2 panels like you wanted.
public class ValueUpdate extends JFrame {
int x = 0;
final JLabel label = new JLabel(String.valueOf(x));
ValueUpdate() {
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
panel1.add(label);
JButton btn = new JButton("Increment");
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
x++;
label.setText(String.valueOf(x));
}
});
panel2.add(btn);
getContentPane().add(panel1, BorderLayout.CENTER);
getContentPane().add(panel2, BorderLayout.PAGE_END);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
setVisible(true);
}
public static void main(String[] args) {
new ValueUpdate();
}
}