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, ≈46🔥, 1💬
Popular Posts:
JDK 11 java.smartcardio.jmod is the JMOD file for JDK 11 Smartcardio module. JDK 11 Smart Card IO mo...
Rhino JavaScript Java Library is an open-source implementation of JavaScript written entirely in Jav...
How to read XML document from socket connections with the socket\DelayedInput.java provided in the A...
JDK 11 jdk.internal.vm.compiler .jmodis the JMOD file for JDK 11 Internal VM Compiler module. JDK 11...
What JAR files are required to run sax\Counter.java provided in the Apache Xerces package? You can f...