Creating a console in Java

When I try to use Java lang.System. Console(), I get a null pointer I can still write and read from it, but this only works when I run directly from the IDE When I run directly Jar file, no response How can I create a console like I saw using STD:: cout in Java?

Editor: I want to create only one, not understand why I don't, because I need one for my program operation

Solution

Maybe you tried to get the console by double clicking the jar

Try creating a batch file that opens the console for you

However, you can use swing to create a console and redirect standard I / O there

Source: create Java console inside a GUI panel

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>