KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > license > LicensePanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.license;
21
22 import java.io.IOException JavaDoc;
23 import java.net.URL JavaDoc;
24 import java.util.ResourceBundle JavaDoc;
25
26 import org.openide.util.NbBundle;
27
28 /**
29  * This class displays license during first start of IDE.
30  *
31  * @author Marek Slama
32  */

33 final class LicensePanel extends javax.swing.JPanel JavaDoc {
34
35     /** Creates new form LicensePanel */
36     public LicensePanel(URL JavaDoc url) {
37         this.url = url;
38         initComponents();
39         initAccessibility();
40         try {
41             jEditorPane1.setPage(url);
42         } catch (IOException JavaDoc exc) {
43             //Problem with locating file
44
System.err.println("Exception: " + exc.getMessage()); //NOI18N
45
exc.printStackTrace();
46         }
47     }
48     
49     private void initAccessibility() {
50         this.getAccessibleContext().setAccessibleName
51         (bundle.getString("ACSN_LicensePanel"));
52         this.getAccessibleContext().setAccessibleDescription
53         (bundle.getString("ACSD_LicensePanel"));
54         
55         jEditorPane1.getAccessibleContext().setAccessibleName
56         (bundle.getString("ACSN_EditorPane"));
57         jEditorPane1.getAccessibleContext().setAccessibleDescription
58         (bundle.getString("ACSD_EditorPane"));
59     }
60     
61     /** This method is called from within the constructor to
62      * initialize the form.
63      * WARNING: Do NOT modify this code. The content of this method is
64      * always regenerated by the Form Editor.
65      */

66     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
67
private void initComponents() {
68         jTextAreaTop = new javax.swing.JTextArea JavaDoc();
69         jScrollPane1 = new javax.swing.JScrollPane JavaDoc();
70         jEditorPane1 = new javax.swing.JEditorPane JavaDoc();
71         jTextAreaBottom = new javax.swing.JTextArea JavaDoc();
72
73         setLayout(new javax.swing.BoxLayout JavaDoc(this, javax.swing.BoxLayout.Y_AXIS));
74
75         setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 0, 11));
76         jTextAreaTop.setBackground(getBackground());
77         jTextAreaTop.setColumns(20);
78         jTextAreaTop.setEditable(false);
79         jTextAreaTop.setFont(new java.awt.Font JavaDoc("Dialog", 1, 12));
80         jTextAreaTop.setLineWrap(true);
81         jTextAreaTop.setRows(1);
82         jTextAreaTop.setText(bundle.getString("MSG_LicenseDlgLabelTop"));
83         jTextAreaTop.setWrapStyleWord(true);
84         jTextAreaTop.setFocusable(false);
85         jTextAreaTop.setMargin(new java.awt.Insets JavaDoc(0, 0, 2, 0));
86         jTextAreaTop.setRequestFocusEnabled(false);
87         add(jTextAreaTop);
88
89         jEditorPane1.setEditable(false);
90         jEditorPane1.setPreferredSize(new java.awt.Dimension JavaDoc(500, 500));
91         jScrollPane1.setViewportView(jEditorPane1);
92
93         add(jScrollPane1);
94
95         jTextAreaBottom.setBackground(getBackground());
96         jTextAreaBottom.setColumns(20);
97         jTextAreaBottom.setEditable(false);
98         jTextAreaBottom.setFont(new java.awt.Font JavaDoc("Dialog", 1, 12));
99         jTextAreaBottom.setLineWrap(true);
100         jTextAreaBottom.setRows(2);
101         jTextAreaBottom.setText(bundle.getString("MSG_LicenseDlgLabelBottom"));
102         jTextAreaBottom.setWrapStyleWord(true);
103         jTextAreaBottom.setFocusable(false);
104         jTextAreaBottom.setRequestFocusEnabled(false);
105         add(jTextAreaBottom);
106
107     }// </editor-fold>//GEN-END:initComponents
108

109     
110     // Variables declaration - do not modify//GEN-BEGIN:variables
111
private javax.swing.JEditorPane JavaDoc jEditorPane1;
112     private javax.swing.JScrollPane JavaDoc jScrollPane1;
113     private javax.swing.JTextArea JavaDoc jTextAreaBottom;
114     private javax.swing.JTextArea JavaDoc jTextAreaTop;
115     // End of variables declaration//GEN-END:variables
116
private URL JavaDoc url;
117     private static final ResourceBundle JavaDoc bundle = NbBundle.getBundle(LicensePanel.class);
118 }
119
Popular Tags