Created
March 14, 2013 03:56
-
-
Save fanjavaid/5158700 to your computer and use it in GitHub Desktop.
Pemanggilan Listener lain di dalam ActionListener
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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