Java Utililty Methods JTextComponent Row

List of utility methods to do JTextComponent Row

  1. HOME
  2. Java
  3. J
  4. JTextComponent Row

Description

The list of methods to do JTextComponent Row are organized into topic(s).

Method

int getRow(int pos, JTextComponent editor)
get Row
int rn = (pos == 0) ? 1 : 0;
int offs = pos;
while (offs > 0) {
 offs = Utilities.getRowStart(editor, offs) - 1;
 rn++;
return rn;
int getRow(JTextComponent editor, int pos)
get Row
int rn = (pos == 0) ? 1 : 0;
try {
 int offs = pos;
 while (offs > 0) {
 offs = Utilities.getRowStart(editor, offs) - 1;
 rn++;
} catch (BadLocationException e) {
...
int getRowStart(JTextComponent c, int offs)
Determines the starting row model position of the row that contains the specified model position.
Rectangle r = c.modelToView(offs);
if (r == null) {
 return -1;
int lastOffs = offs;
int y = r.y;
while ((r != null) && (y == r.y)) {
 offs = lastOffs;
...

AltStyle によって変換されたページ (->オリジナル) /