+ 2
How i can program a button to do some thing when i click on it in java .
button
5 Answers
+ 2
See here https://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html
Bookmarks this site for learn futhermore đ
+ 2
Depends on framework that you are using... In swing you have to add an action listener to button and implement actionPerformed method:
myButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
// your code here
}
});
+ 1
thanx
+ 1
đđđ
0
so thank u i understand but a little if you can specify the types of (action listener )or show me where i can find information about it .