public class Underline
extends java.lang.Object
Examples:
Shows how to insert a hyperlink field.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("For more information, please visit the ");
// Insert a hyperlink and emphasize it with custom formatting.
// The hyperlink will be a clickable piece of text which will take us to the location specified in the URL.
builder.getFont().setColor(Color.BLUE);
builder.getFont().setUnderline(Underline.SINGLE);
builder.insertHyperlink("Google website", "https://www.google.com", false);
builder.getFont().clearFormatting();
builder.writeln(".");
// Ctrl + left clicking the link in the text in Microsoft Word will take us to the URL via a new web browser window.
doc.save(getArtifactsDir() + "DocumentBuilder.InsertHyperlink.docx");
| Modifier and Type | Field and Description |
|---|---|
static int |
DASH |
static int |
DASH_HEAVY |
static int |
DASH_LONG |
static int |
DASH_LONG_HEAVY |
static int |
DOT_DASH |
static int |
DOT_DASH_HEAVY |
static int |
DOT_DOT_DASH |
static int |
DOT_DOT_DASH_HEAVY |
static int |
DOTTED |
static int |
DOTTED_HEAVY |
static int |
DOUBLE |
static int |
length |
static int |
NONE |
static int |
SINGLE |
static int |
THICK |
static int |
WAVY |
static int |
WAVY_DOUBLE |
static int |
WAVY_HEAVY |
static int |
WORDS |
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String underlineName) |
static java.lang.String |
getName(int underline) |
static int[] |
getValues() |
static java.lang.String |
toString(int underline) |
public static int NONE
public static int SINGLE
public static int WORDS
public static int DOUBLE
public static int DOTTED
public static int THICK
public static int DASH
public static int DASH_LONG
public static int DOT_DASH
public static int DOT_DOT_DASH
public static int WAVY
public static int DOTTED_HEAVY
public static int DASH_HEAVY
public static int DASH_LONG_HEAVY
public static int DOT_DASH_HEAVY
public static int DOT_DOT_DASH_HEAVY
public static int WAVY_HEAVY
public static int WAVY_DOUBLE
public static int length