Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JBrowser Source Code Files
JBrowser Source Code Files are provided in the
source package file.
You can download JBrowser source package as described in the previous tutorial and go to the "src" sub-folder to view Source Code files.
You can also browse JBrowser Source Code files below:
✍: FYIcenter
⏎ org/mozilla/browser/impl/components/JMultiLineLabel.java
package org.mozilla.browser.impl.components;
import java.util.Vector;
import javax.swing.JLabel;
/**
* Implements a JLabel-like component, that is capable
* to display several lines of text
*/
public class JMultiLineLabel extends JLabel
{
private static final long serialVersionUID = 1L;
public void setText(String s) {
if (s == null) s = ""; //$NON-NLS-1$
String lines[] = breakupLines(s);
StringBuffer sb = new StringBuffer();
sb.append("<html>"); //$NON-NLS-1$
for (int i=0; i<lines.length; i++) {
if (i>0) sb.append("<br>"); //$NON-NLS-1$
sb.append(lines[i]);
}
sb.append("</html>"); //$NON-NLS-1$
super.setText(sb.toString());
}
private static String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
private static int LINE_SEPARATOR_LEN = LINE_SEPARATOR.length();
@SuppressWarnings("unchecked") //$NON-NLS-1$
public static String[] breakupLines(String text) {
int len = text.length();
if (len == 0) return new String[] {""}; //$NON-NLS-1$
else {
Vector data = new Vector(10);
int start=0;
int i=0;
while (i<len) {
if (text.startsWith(LINE_SEPARATOR,i)) {
data.addElement(text.substring(start,i));
start=i+LINE_SEPARATOR_LEN;
i=start;
}
else if (text.charAt(i)=='\n') {
data.addElement(text.substring(start,i));
start=i+1;
i=start;
}
else { i++; }
}
if (start != len) {
data.addElement(text.substring(start));
}
int numlines = data.size();
String lines[] = new String[numlines];
data.copyInto(lines);
return lines;
}
}
}
⏎ org/mozilla/browser/impl/components/JMultiLineLabel.java
Or download all of them as a single archive file:
File name: jbrowser-1.9-fyi.zip File size: 625318 bytes Release date: 2022-11-10 Download
⇐ Download and Install JBrowser Source Package
2017-07-17, ≈22🔥, 1💬
Popular Posts:
How to show the XML parsing flow with sax\DocumentTracer.java provided in the Apache Xerces package?...
JDK 17 java.sql.rowset.jmod is the JMOD file for JDK 17 SQL Rowset module. JDK 17 SQL Rowset module ...
JUnit Source Code Files are provided in the source package file, junit-4.13.2-sources.jar .You can b...
Xalan-Java, Version 2.7.1, is an XSLT processor for transforming XML documents into HTML, text, or o...
What Is junit-3.8.1.jar? junit-3.8.1.jar is the version 3.8.1 of JUnit JAR library file. JUnit is a ...