| 1 19 20 package org.netbeans.bluej.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 34 final class LicensePanel extends javax.swing.JPanel { 35 36 37 public LicensePanel(URL url) { 38 this.url = url; 39 initComponents(); 40 initAccessibility(); 41 try { 42 jEditorPane1.setPage(url); 43 } catch (IOException exc) { 44 System.err.println("Exception: " + exc.getMessage()); 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 67 private void initComponents() { 69 jTextAreaTop = new javax.swing.JTextArea (); 70 jScrollPane1 = new javax.swing.JScrollPane (); 71 jEditorPane1 = new javax.swing.JEditorPane (); 72 jTextAreaBottom = new javax.swing.JTextArea (); 73 74 setLayout(new javax.swing.BoxLayout (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 ("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 (0, 0, 2, 0)); 87 jTextAreaTop.setRequestFocusEnabled(false); 88 add(jTextAreaTop); 89 90 jEditorPane1.setEditable(false); 91 jEditorPane1.setPreferredSize(new java.awt.Dimension (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 ("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 } 110 111 private javax.swing.JEditorPane jEditorPane1; 113 private javax.swing.JScrollPane jScrollPane1; 114 private javax.swing.JTextArea jTextAreaBottom; 115 private javax.swing.JTextArea jTextAreaTop; 116 private URL url; 118 private static final ResourceBundle bundle = NbBundle.getBundle(LicensePanel.class); 119 } 120 | Popular Tags |