X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTField.java;h=b4330b4cb3c809210c4abf07b6592b0ac69bbd20;hb=c1d8e2b874088d4336bd3ba0a04623176d2039a0;hp=8f693f2123539abfc8b4ca85ba923441cfada52c;hpb=d36057dfab8def933a64be042b039d76708ac5ba;p=nikiroo-utils.git diff --git a/src/jexer/TField.java b/src/jexer/TField.java index 8f693f2..b4330b4 100644 --- a/src/jexer/TField.java +++ b/src/jexer/TField.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2017 Kevin Lamonte + * Copyright (C) 2019 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -358,9 +358,8 @@ public class TField extends TWidget { if (end > text.length()) { end = text.length(); } - getScreen().hLineXY(0, 0, getWidth(), GraphicsChars.HATCH, fieldColor); - getScreen().putStringXY(0, 0, text.substring(windowStart, end), - fieldColor); + hLineXY(0, 0, getWidth(), GraphicsChars.HATCH, fieldColor); + putStringXY(0, 0, text.substring(windowStart, end), fieldColor); // Fix the cursor, it will be rendered by TApplication.drawAll(). updateCursor(); @@ -384,7 +383,8 @@ public class TField extends TWidget { * * @param text the new field text */ - public final void setText(String text) { + public void setText(final String text) { + assert (text != null); this.text = text; position = 0; windowStart = 0;