Underline

Inheritance: java.lang.Object

public class Underline

Indicates type of the underline applied to a font.

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");
 

Fields

FieldDescription
DASH
DASH_HEAVY
DASH_LONG
DASH_LONG_HEAVY
DOTTED
DOTTED_HEAVY
DOT_DASH
DOT_DASH_HEAVY
DOT_DOT_DASH
DOT_DOT_DASH_HEAVY
DOUBLE
NONE
SINGLE
THICK
WAVY
WAVY_DOUBLE
WAVY_HEAVY
WORDS
length

Methods

MethodDescription
fromName(String underlineName)
getName(int underline)
getValues()
toString(int underline)

DASH

public static int DASH

DASH_HEAVY

public static int DASH_HEAVY

DASH_LONG

public static int DASH_LONG

DASH_LONG_HEAVY

public static int DASH_LONG_HEAVY

DOTTED

public static int DOTTED

DOTTED_HEAVY

public static int DOTTED_HEAVY

DOT_DASH

public static int DOT_DASH

DOT_DASH_HEAVY

public static int DOT_DASH_HEAVY

DOT_DOT_DASH

public static int DOT_DOT_DASH

DOT_DOT_DASH_HEAVY

public static int DOT_DOT_DASH_HEAVY

DOUBLE

public static int DOUBLE

NONE

public static int NONE

SINGLE

public static int SINGLE

THICK

public static int THICK

WAVY

public static int WAVY

WAVY_DOUBLE

public static int WAVY_DOUBLE

WAVY_HEAVY

public static int WAVY_HEAVY

WORDS

public static int WORDS

length

public static int length

fromName(String underlineName)

public static int fromName(String underlineName)

Parameters:

ParameterTypeDescription
underlineNamejava.lang.String

Returns: int

getName(int underline)

public static String getName(int underline)

Parameters:

ParameterTypeDescription
underlineint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int underline)

public static String toString(int underline)

Parameters:

ParameterTypeDescription
underlineint

Returns: java.lang.String