Search…
Multi Edit

Overview

A MultiEdit is a field used to show or alter text in various disposed line

Source Code

MultiEditSample.java
1
import totalcross.sys.Settings;
2
import totalcross.ui.MainWindow;
3
import totalcross.ui.MultiEdit;
4
5
public class MultiEditSample extends MainWindow {
6
public MultiEditSample() {
7
setUIStyle(Settings.MATERIAL_UI);
8
Settings.uiAdjustmentsBasedOnFontHeight = true;
9
}
10
11
public void initUI() {
12
MultiEdit multiEdit = new MultiEdit();
13
multiEdit.caption = "MultiEdit";
14
add(multiEdit, LEFT + 100,CENTER, FILL - 100, DP + 48);
15
}
16
}
Copied!

Attributes

Type
Name
Description
boolean
autoSelect
When true, the text will be selected when the MultiEdit is foccused
String
caption
The MultiEdit's placeholder text
boolean
justify
Justify the text when the MultiEdit is not editable
boolean
drawDots
If true, a dotted line will be drawn on each line

Methods

Type
Name
Description
Constructor
MultEdit( )
Creates a MultiEdit for user input with the default size and spacing
Constructor
MultiEdit(int rowCount, int spaceBetweenLines)
Creates a MultiEdit for user input with the passed row quantity and line spacing.
Constructor
MultiEdit(String mask, int rowCount, int spaceBetweenLines)
Creates a MultiEdit for user input with the passed row quantity and line spacing, but with a mask.
void
setEditable(boolean on)
Will enable or disable the MultiEdit. Can be used as a way to make sure the user don't modify something that was already saved on server and can't be modified without proper authorization
String
getText( )
Returns the text within the MultiEdit
void
setMaxLength(int length)
Is used to limit the characters number the user can digit on the text field

References

Last modified 2yr ago