Revision 21 org.gvsig.hyperlink.app/trunk/org.gvsig.hyperlink.app/org.gvsig.hyperlink.app.extension/src/main/java/org/gvsig/hyperlink/app/extension/actions/TxtPanel.java

View differences:

TxtPanel.java
24 24

  
25 25
import java.awt.BorderLayout;
26 26
import java.awt.Color;
27
import java.awt.Dimension;
27 28
import java.io.IOException;
28 29
import java.net.MalformedURLException;
29 30
import java.net.URI;
30 31
import java.net.URL;
32
import javax.swing.JScrollPane;
31 33

  
32 34
import javax.swing.JTextPane;
33 35
import javax.swing.event.HyperlinkEvent;
......
74 76
    protected void showDocument() {
75 77
        textPane = new JTextPane();
76 78
        textPane.setEditable(false);
77
        textPane.setBackground(Color.RED);
79
        textPane.setCaretPosition(0);
78 80

  
81
        JScrollPane scrollPane = new JScrollPane(textPane);
82
        scrollPane.setPreferredSize(new Dimension(400, 220));
83
                
79 84
        if (!checkAndNormalizeURI()) {
80 85
            return;
81 86
        }
......
94 99

  
95 100
                public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e) {
96 101
                    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
97
                        System.out.println("hyperlinkUpdate()");
98 102
                        BrowserControl.displayURL(e.getURL().toString());
99 103
                    }
100 104
                }
......
104 108
                "Hyperlink_linked_field_doesnot_exist"), e);
105 109
            return;
106 110
        }
107
        this.add(textPane, BorderLayout.CENTER);
111
        this.add(scrollPane, BorderLayout.CENTER);
108 112
    }
109 113
}

Also available in: Unified diff