forked from guptalab/3dna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTwitterActionListener.java
36 lines (30 loc) · 1.1 KB
/
TwitterActionListener.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** Author: Shikhar K Gupta, Foram Joshi
* Project: DNA Pen
* Mentor: Prof. Manish K Gupta
*/
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.JOptionPane;
public class TwitterActionListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
Desktop desktop = Desktop.getDesktop();
try {
URI updateLink = new URI("http://www.twitter.com/3DNA");
desktop.browse(updateLink);
} catch (URISyntaxException e1) {
e1.printStackTrace(System.out);
JOptionPane.showMessageDialog(null, "Exception occurred.",
"Error!", JOptionPane.INFORMATION_MESSAGE);
} catch (IOException e2) {
e2.printStackTrace(System.out);
JOptionPane.showMessageDialog(null, "Exception occurred.",
"Error!", JOptionPane.INFORMATION_MESSAGE);
}
}
}