1 19 20 package org.netbeans.license; 21 22 import java.io.IOException ; 23 import java.net.URL ; 24 import java.util.ResourceBundle ; 25 26 import org.openide.util.NbBundle; 27 28 33 final class LicensePanel extends javax.swing.JPanel { 34 35 36 public LicensePanel(URL url) { 37 this.url = url; 38 initComponents(); 39 initAccessibility(); 40 try { 41 jEditorPane1.setPage(url); 42 } catch (IOException exc) { 43 System.err.println("Exception: " + exc.getMessage()); 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 66 private void initComponents() { 68 jTextAreaTop = new javax.swing.JTextArea (); 69 jScrollPane1 = new javax.swing.JScrollPane (); 70 jEditorPane1 = new javax.swing.JEditorPane (); 71 jTextAreaBottom = new javax.swing.JTextArea (); 72 73 setLayout(new javax.swing.BoxLayout (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 ("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 (0, 0, 2, 0)); 86 jTextAreaTop.setRequestFocusEnabled(false); 87 add(jTextAreaTop); 88 89 jEditorPane1.setEditable(false); 90 jEditorPane1.setPreferredSize(new java.awt.Dimension (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 ("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 } 109 110 private javax.swing.JEditorPane jEditorPane1; 112 private javax.swing.JScrollPane jScrollPane1; 113 private javax.swing.JTextArea jTextAreaBottom; 114 private javax.swing.JTextArea jTextAreaTop; 115 private URL url; 117 private static final ResourceBundle bundle = NbBundle.getBundle(LicensePanel.class); 118 } 119 | Popular Tags |