Graphical User Interface
i badly need a help . . hope u could help me guys . .. this is my program and the problem is thaT i need to have another window which counts the number of times that the "PRESS ME" button has been clicked. What would be my code? The prefer program language to be used is JAVA.

import javax.swing.*;
import java.awt.*;

public class ButtonGuiOne extends JFrame {
private JFrame mainFrame;
private JButton firstButton;

public ButtonGuiOne() {
mainFrame = new JFrame("Example of a GUI with a Button");

//create a button object
firstButton = new JButton("Press me");
mainFrame.getContentPane().add(first…

//insert tooltip and accelerator key
firstButton.setToolTipText("This is a button");
firstButton.setMnemonic('P');
mainFrame.setSize(300,150);
mainFrame.show();
mainFrame.setDefaultCloseOperation(J…
}

public static void main(String[] args) {
new ButtonGuiOne();
}
}

all answers will be greatly appreciated. thanks.
Graphical User Interface
===

i badly need a help . . hope u could help me guys . .. this is my program and the problem is thaT i need to have another window which counts the number of times that the "PRESS ME" button has been clicked. What would be my code? The prefer program language to be used is JAVA.

import javax.swing.*;
import java.awt.*;

public class ButtonGuiOne extends JFrame {
private JFrame mainFrame;
private JButton firstButton;

public ButtonGuiOne() {
mainFrame = new JFrame("Example of a GUI with a Button");

//create a button object
firstButton = new JButton("Press me");
mainFrame.getContentPane().add(first…

//insert tooltip and accelerator key
firstButton.setToolTipText("This is a button");
firstButton.setMnemonic('P');
mainFrame.setSize(300,150);
mainFrame.show();
mainFrame.setDefaultCloseOperation(J…
}

public static void main(String[] args) {
new ButtonGuiOne();
}
}

all answers will be greatly appreciated. thanks.