How to create a box around text in Java. Inside windows cmd.exe

Click For Summary
SUMMARY

This discussion focuses on creating a solid box around text in Java for display in the Windows command prompt (cmd.exe) using only the System.out.print() and System.out.println() methods. Participants emphasize the requirement to avoid using symbols like '-' or '_' for the box's borders. The conversation highlights the need for a step-by-step explanation suitable for beginners, with a focus on using various data types such as int, double, char, String, and boolean in the implementation.

PREREQUISITES
  • Basic understanding of Java programming syntax
  • Familiarity with System.out.print() and System.out.println() methods
  • Knowledge of data types in Java (int, double, char, String, boolean)
  • Experience with command line interfaces, specifically Windows cmd.exe
NEXT STEPS
  • Research how to manipulate console output in Java
  • Learn about character encoding and its impact on console display
  • Explore Java's String formatting techniques for better output control
  • Investigate alternative Java libraries for enhanced console graphics
USEFUL FOR

Beginner Java programmers, educators teaching Java basics, and anyone interested in console output formatting in Java applications.

RockHopper
Messages
1
Reaction score
0
How can I make a box around text in Java which will appear in Windows cmd.exe?

Only using System.out.print("X"); and System.out.println("X"); . It MUST be a solid box and not use symbols like - or _ .

It can also use int X , double X, char X, String X, and boolean X.



Please explain it step by step. I'm a complete noob. :-)
 
Technology news on Phys.org
RockHopper said:
How can I make a box around text in Java which will appear in Windows cmd.exe?

Only using System.out.print("X"); and System.out.println("X"); . It MUST be a solid box and not use symbols like - or _ .

It can also use int X , double X, char X, String X, and boolean X.

Please explain it step by step. I'm a complete noob. :-)

Is this a homework assignment? If so, you need to show what you've tried before we can give any help. See the rules here - https://www.physicsforums.com/showthread.php?t=414380 - especially the section titled Homework Help.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
6K
Replies
1
Views
8K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
Replies
3
Views
4K
Replies
2
Views
3K
  • · Replies 26 ·
Replies
26
Views
8K