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, ≈25🔥, 1💬
Popular Posts:
JDK 11 jdk.internal.vm.compiler .jmodis the JMOD file for JDK 11 Internal VM Compiler module. JDK 11...
HttpComponents Client Source Code Files are provided in the source package file, httpcomponents-clie...
Where to get the Java source code for Connector/J 8.0 Core Impl module? Java source code files for C...
How to display types defined in an XML Schema file with the xs\QueryXS.java provided in the Apache X...
What is the sax\Writer.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 insta...