From 036a419b8854688ed2bcf36f750434fbd9417710 Mon Sep 17 00:00:00 2001 From: OdiNomina <157019238+OdiNomina@users.noreply.github.com> Date: Mon, 27 Jan 2025 12:06:22 +0100 Subject: [PATCH] Use fromCharacter() of class TextCharacter instead of constructor. The constructor TextCharacter(char, TextColor, TextColor, SGR...) is deprecated. --- .../java/com/googlecode/lanterna/tutorial/Tutorial03.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/test/java/com/googlecode/lanterna/tutorial/Tutorial03.java b/src/test/java/com/googlecode/lanterna/tutorial/Tutorial03.java index fd00a0ebb..76e4fe847 100644 --- a/src/test/java/com/googlecode/lanterna/tutorial/Tutorial03.java +++ b/src/test/java/com/googlecode/lanterna/tutorial/Tutorial03.java @@ -61,11 +61,7 @@ though, a Screen holds two text character surfaces (front and back) which corres TerminalSize terminalSize = screen.getTerminalSize(); for(int column = 0; column < terminalSize.getColumns(); column++) { for(int row = 0; row < terminalSize.getRows(); row++) { - screen.setCharacter(column, row, new TextCharacter( - ' ', - TextColor.ANSI.DEFAULT, - // This will pick a random background color - TextColor.ANSI.values()[random.nextInt(TextColor.ANSI.values().length)])); + screen.setCharacter(column, row, TextCharacter.fromCharacter(' ', TextColor.ANSI.DEFAULT, TextColor.ANSI.values()[random.nextInt(TextColor.ANSI.values().length)])[0]); } }