I created a button and I want these:
When the user clicks the button, it stays pressed like 3 seconds. After 3 seconds the button should be again look pressable. So the
May this help you
btn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { btn.setEnabled(false); doSomething() ; btn.setEnabled(true); } });