11.07.2015 Views

Intro to Android

Intro to Android

Intro to Android

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Starting the worker thread Create an instance of your subclass ofSwingWorker and call its .execute() methodFetcher fetcher = new Fetcher();fetcher.execute();● Equivalent <strong>to</strong> the usual Thread.start() E.g., in a but<strong>to</strong>n's action listener:but<strong>to</strong>n.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {Fetcher fetcher = new Fetcher();fetcher.execute();}});CMPT166: SwingWorker; <strong>Android</strong> 17 Mar 20117

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!