KickJava   Java API By Example, From Geeks To Geeks.

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

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

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