I am making a small project, and in it I have a JFrame with 5 buttons. 3 buttons are of primary concern and are enabled by default.
What I want is until and unless any of those 3 buttons are pressed rest of the 2 should remain disabled.
I tried with ActionListner and MouseListener but to no avail.
Check the multiple code that i tried.
What am I doing wrong here ? I even tried mouseClicked method for the same code but nothing happened.
Please help.
What I want is until and unless any of those 3 buttons are pressed rest of the 2 should remain disabled.
I tried with ActionListner and MouseListener but to no avail.
Check the multiple code that i tried.
Code:
public void mousePressed (MouseEvent me){
if (me.getButton() == MouseEvent.NOBUTTON ){
proceedBtn.setEnabled(false);
proceedBtn.setToolTipText("Please Enter A Button Before Proceeding");
}
else {
proceedBtn.setEnabled(true);
}
}
Code:
public void mousePressed (MouseEvent me){
if (me.getClickCount == 0 ){
proceedBtn.setEnabled(false);
proceedBtn.setToolTipText("Please click a button Before Proceeding");
}
else {
proceedBtn.setEnabled(true);
}
}
What am I doing wrong here ? I even tried mouseClicked method for the same code but nothing happened.
Please help.