Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void showInfoDialog() {
- final JEditorPane editorPane = new JEditorPane();
- editorPane.setPreferredSize(new Dimension(520, 180));
- editorPane.setEditable(false);
- editorPane.setContentType("text/html");
- editorPane.addHyperlinkListener(new HyperlinkListener() {
- @Override
- public void hyperlinkUpdate(HyperlinkEvent e) {
- if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
- if (Desktop.isDesktopSupported()) {
- try {
- Desktop.getDesktop().browse(e.getURL().toURI());
- } catch (IOException e1) {
- e1.printStackTrace();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- }
- }
- }
- });
- String message = "<html>Autor: Martin Sobek<br> e-mail: <a href=\"mailto:masodj@centrum.cz\">masodj@centrum.cz</a> </html>";
- editorPane.setText(message);
- JOptionPane.showMessageDialog(this, editorPane, "Informace",
- JOptionPane.INFORMATION_MESSAGE);
- }
Add Comment
Please, Sign In to add comment