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, ≈40🔥, 1💬
Popular Posts:
JRE 8 plugin.jar is the JAR file for JRE 8 Java Control Panel Plugin interface and tools. JRE (Java ...
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
Apache Commons Codec library provides implementations of common encoders and decoders such as Base64...
commons-collections4-4.4 -sources.jaris the source JAR file for Apache Commons Collections 4.2, whic...
How to perform XML Schema validation with dom\Writer.java provided in the Apache Xerces package? You...