Skip to content

Instantly share code, notes, and snippets.

@fanjavaid
Created March 14, 2013 03:56
Show Gist options
  • Save fanjavaid/5158700 to your computer and use it in GitHub Desktop.
Save fanjavaid/5158700 to your computer and use it in GitHub Desktop.
Pemanggilan Listener lain di dalam ActionListener
public class ContohKelas implements PropertyChangeListener {
public void createGraph() {
// Pemanggilan diluar ActionListener dengan this sukses.
// graph = DSCapture.fromUserDialog(jf, DSFiltergraph.DD7, this);
btnStart.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
/*
* Bagaimana mengambil PropertyChangeListener tsb sebagai method di dalam sini?
* Kalau diluar bisa dipanggil dengan keyword this
*/
// Error terjadi di keyword this nya
// Saya ingin memanggil PropertyChangeListener yg diimplement di parameter this nya
graph = DSCapture.fromUserDialog(jf, DSFiltergraph.DD7, this);
}
});
}
// Implement interface method
@Override
public void propertyChange(PropertyChangeEvent pe) {
//...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment