Thursday, June 26, 2014

Can the Action perform method be changed to add extra arguments to it
































































Hi i was wondering two questions one which i think is a No. If it a "No" how do i create a custom one to be able to pass an extra argument
































































Here is the below code
































































































Java Code:






































































//Add action listener to button
button.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)
{
//Execute when button is pressed
System.out.println("You clicked the button");
}
});




































































































































I want to be able to change it or create a custom one that will do this or something custom that will be able to perform the same thing but with an extra argument































































Java Code:






































































//Add action listener to button
button.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e, String Arg1)
{
//Execute when button is pressed
System.out.println("You clicked the button");
}
});




































































Thanks in advanced






























































































No comments:

Post a Comment