lanterna | Java library for creating text-based GUIs | Command Line Interface library

 by   mabe02 Java Version: 3.1.2 License: LGPL-3.0

kandi X-RAY | lanterna Summary

kandi X-RAY | lanterna Summary

lanterna is a Java library typically used in Utilities, Command Line Interface applications. lanterna has no vulnerabilities, it has build file available, it has a Weak Copyleft License and it has high support. However lanterna has 66 bugs. You can download it from GitHub, Maven.

Lanterna is a Java library allowing you to write easy semi-graphical user interfaces in a text-only environment, very similar to the C library curses but with more functionality. Lanterna is supporting xterm compatible terminals and terminal emulators such as konsole, gnome-terminal, putty, xterm and many more. One of the main benefits of lanterna is that it's not dependent on any native library but runs 100% in pure Java. Also, when running Lanterna on computers with a graphical environment (such as Windows or Xorg), a bundled terminal emulator written in Swing will be used rather than standard output. This way, you can develop as usual from your IDE (most of them doesn't support ANSI control characters in their output window) and then deploy to your headless server without changing any code. Lanterna is structured into three layers, each built on top of the other and you can easily choose which one fits your needs best.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              lanterna has a highly active ecosystem.
              It has 2031 star(s) with 244 fork(s). There are 71 watchers for this library.
              There were 2 major release(s) in the last 12 months.
              There are 69 open issues and 346 have been closed. On average issues are closed in 39 days. There are 9 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of lanterna is 3.1.2

            kandi-Quality Quality

              OutlinedDot
              lanterna has 66 bugs (7 blocker, 5 critical, 43 major, 11 minor) and 870 code smells.

            kandi-Security Security

              lanterna has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              lanterna code analysis shows 0 unresolved vulnerabilities.
              There are 40 security hotspots that need review.

            kandi-License License

              lanterna is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              lanterna releases are not available. You will need to build from source code and install.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              lanterna saves you 16423 person hours of effort in developing the same functionality from scratch.
              It has 32661 lines of code, 3076 functions and 337 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed lanterna and discovered the below as its top functions. This is intended to give you an instant insight into lanterna implemented functionality, and help decide if they suit your requirements.
            • Handle a key stroke
            • Handles a key stroke
            • Helper method to perform the cursor up
            • Performs the caret position on the cursor
            • Layout the components in the given area
            • Get the preferred columns for a table
            • Computes the preferred heights for each component
            • Builds the table for the given components
            • Fills a triangle
            • Implements the layout of the given area
            • Matches the given sequence of characters
            • Match input
            • Creates the thumbnail
            • Attempts to match a sequence of characters
            • Compares this terminal to another TerminalPalette
            • Scrolls the specified number of lines
            • Draws a background GUI
            • Match a sequence of characters
            • Get a hash code for this object
            • Draws a fat window
            • Write a string
            • Creates a key stroke from a string
            • Draw a text GUI
            • Returns a String representation of the KeyStroke
            • After rendering the window
            • Override drawComponent to draw the layout
            Get all kandi verified functions for this library.

            lanterna Key Features

            No Key Features are available at this moment for lanterna.

            lanterna Examples and Code Snippets

            No Code Snippets are available at this moment for lanterna.

            Community Discussions

            QUESTION

            Maven not packing sound resources into JAR
            Asked 2020-Jun-20 at 13:18

            I've been a while trying to figure this out, but to no avail :/

            This is my POM part

            ...

            ANSWER

            Answered 2020-Jun-19 at 18:48

            If you are trying to identify files within a .jar, you need to use URL, not File. An IDE is able to use File, as all the files are located in visible directories. But once the resource is within a jar, the File command will no longer work.

            IDK enough about Maven to comment about why the resource was not jarred. But when I compile programs at the CLI, I have to add a manual step of coping resources into the compiled program's file system. AFAIK, javac does not do this. (There may be CLI options to java that can provide this but I haven't learned them if there are).

            Source https://stackoverflow.com/questions/62473335

            QUESTION

            Intellij building broken JAR artifact
            Asked 2020-Apr-29 at 12:10

            I am trying to build a JAR artifact for my project which relies on one external library nbvcxz and one imported library lanterna:

            When adding the JAR under Artifacts in Project Structure, JAR -> from modules with dependencies is used:

            The additional features I have added to the imported library are:

            • window is not resizable
            • window title has been set to 'Password Gamification'
            • application icon has been set to a padlock

            Compiling the SNAPSHOT jar of the lanterna library works as expected when running the application from within the IDE, with all of the above features and the external library working perfectly. However when I build and run the JAR artifact, the title of the window is updated and the window itself is not resiable, but the customised icon is not shown and selecting any element on the initial start screen will cause it to break.

            Behavior when running from within Intellij (correct):

            Behaviour when running the JAR artifact (incorrect):

            What I find interesting is that the built artifact is using the lanterna library as the initial screen is displayed (lanterna is a semi-graphical library used for text-based GUIs), but is somehow omitting some of the changes I have made to it. The nbvcxz library is imported from maven and works as expected.

            Any help would be greatly appreciated!

            ...

            ANSWER

            Answered 2020-Apr-29 at 12:10

            I found the problem - I was using a text file that was not specified in the source folder, so the packaged JAR was unable to find it during execution which was causing the break as soon as I selected any item from the action list box. Annoyingly, I was not receiving any error message in the console despite catching and printing any exceptions. It wasn't until I added

            Source https://stackoverflow.com/questions/61387349

            QUESTION

            Regex always returns as NoneType or doesn't find any pattern at all
            Asked 2020-Jan-22 at 12:55

            I got a task to extract/find a pattern in a HTML code and extract/print it.

            I am trying to extract it using regex. I am sadly a complete beginner in it.

            Here is the HTML code: https://pastebin.com/cfvtLpZZ

            And here is a part of the code I need to extract:

            ...

            ANSWER

            Answered 2020-Jan-22 at 12:52

            Using https://regex101.com is a good way to find if your regex is good or not. For instance yours is not. ^Re: means that you're looking for something that starts the line with Re: and that just after you're looking for everything(.*) and that ends with span.

            Isnt'

            Source https://stackoverflow.com/questions/59859672

            QUESTION

            Expand programmatically unwrongest accordion
            Asked 2019-Nov-12 at 08:51

            I'm trying to expand programmatically an accordion menu based on saved values in local-storage. The problem is that it saves the values, i get back the values, but it's not expanding the active ones. I use the following accordion library:

            ...

            ANSWER

            Answered 2019-Jul-04 at 11:40

            You have to call the .click() on the a element which handles the click.

            Then it is working fine.

            Eg.

            Source https://stackoverflow.com/questions/56885765

            QUESTION

            Resolve Python Module Error To Enable Web Scraping script?
            Asked 2019-Oct-05 at 17:00

            Using stackoverflow for the first time trying to figure out how to scrape Yelp data and having a hard time. Have set up LXML, beautiful soup, requests, PIP, Python and have added these to the path in system variables yet I am still getting the error below when I try to run code below. Any suggestions?

            File "test2.py", line 4, in from exceptions import ValueError ModuleNotFoundError: No module named 'exceptions'

            ...

            ANSWER

            Answered 2019-Oct-05 at 17:00
            from exceptions import ValueError
            

            Source https://stackoverflow.com/questions/58250469

            QUESTION

            What do I need to compile this lanterna maven project from terminal?
            Asked 2019-May-07 at 12:43

            I'm following a simple lanterna demo tutorial using maven. The problem is that the program runs perfectly using IDE intellij, but wont compile from terminal. Do I need to include something more in my pom.xml file?

            My file Rouge.java opens a simple window with hello world. Error message when trying to compile file from terminal (javac Rouge.java) includes error: package com.googlecode.lanterna.terminal does not exist.

            I thought the problem could be that the packages does not compile and tried to add different maven compiler dependencies but the problem remains.

            ...

            ANSWER

            Answered 2019-May-07 at 12:43

            When you run javac/java command on Rogue.java it tries to look for lanterna-3.0.1.jar dependency which is not be available or neither set in the classpath. With the current pom.xml you shared you will still get java.lang.ClassNotFoundException: com.googlecode.lanterna when you execute(mvn install) it on the .jar file. There are couple of options you could look:

            • you can define maven-assembly-plugin to your build tag in pom.xml. This will create a fat jar which includes all the dependencies
            • if you are in windows you can create .bat script and include your necessary dependency and run the java command. Something like below

              TITLE lanterna demo set classpath=.\lib\* java com.demo.Rogue

            Source https://stackoverflow.com/questions/56020529

            QUESTION

            Java concurrent console IO
            Asked 2019-May-05 at 19:53


            I wrote multithreaded java server-client sockets app with messaging functionality but I encountered a problem with simultaneous console IO.
            Main server console is listening for keyboard input and simultaneously printing out messages from the clients. On client side there is a separate thread for printout.
            Here is simplified code representation:

            ...

            ANSWER

            Answered 2019-May-03 at 19:00

            A distinct non-answer, based on: there is only one console.

            And that console is an artefact from times when multiple threads weren't a real problem. "Works nicely with multiple threads" was never a requirement for that low level console.

            Thus: if you really want a sophisticated solution (that isn't a hack of some sort) simply consider: not using the stdin/stdout console(s).

            Instead: write a simple Swing GUI application. Have one text entry field where input is collected, and one or maybe multiple text fields where your output goes. If you want to be fancy, make it a webapp. I am sure that using some framework, you could put together a working thing within a few hours. You will learn more valuable skills by doing that, instead of spending these hours "working around" the fact that you picked the wrong technology for your problem.

            Update, given the comment by the OP: then the best I can think of: don't write to the console. Write to different files. Open multiple terminals, and use tools like "tail" to show you what is happening with your output file(s).

            Source https://stackoverflow.com/questions/55975512

            QUESTION

            Backspace esc char in Clojure's console
            Asked 2018-Oct-11 at 20:54

            I'm learning Clojure.

            To practice I started rewriting Java app I've written for my son to solve inequalities (like 3 + 2 ? 7).

            In java I did (note using backslash escape chars)

            ...

            ANSWER

            Answered 2018-Oct-11 at 20:23

            You can achieve the above behavior by calling the native Java methods:

            Source https://stackoverflow.com/questions/52768089

            QUESTION

            Invalid JSON send from Swift to Node.js
            Asked 2018-May-28 at 13:07

            I have to send a swift structure to a javascript node.js server, the structure in question contains a string field and an array of type ItemStruct! Below I put the json text! Now I realize that the problem lies in the fact that the json is not properly formatted my question is how can I solve this?

            JSON print from server:

            ...

            ANSWER

            Answered 2018-May-28 at 09:07

            QUESTION

            Code runs inside IDE but fails outside
            Asked 2018-Mar-30 at 22:36

            I am trying to run an example code with Java Lanterna for a terminal GUI. Running the example within Netbeans 8.2 IDE successfully runs (essentially klicking the 'Play' button), but running the JAR file from the Linux terminal fails.

            Main.java:

            ...

            ANSWER

            Answered 2018-Mar-30 at 22:29

            You need what is called a Fat Jar. Basically, you are compiling your code, but not the library you are using. A Fat Jar compiles the libraries with your code.

            Disclaimer: It is better style and coding practice to have your code load the library instead of packaging it with your code, however making a Fat Jar is easier.

            Source https://stackoverflow.com/questions/49582064

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install lanterna

            You can download it from GitHub, Maven.
            You can use lanterna like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the lanterna component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/mabe02/lanterna.git

          • CLI

            gh repo clone mabe02/lanterna

          • sshUrl

            git@github.com:mabe02/lanterna.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link