当前位置 博文首页 > 如何在JAVA中设置字体样式和大小?_连役的博客:java中如何设置
我是新来的Java和无法弄清楚如何格式化我的代码是这样的: 字体“宋体”字体大小“9”大胆如何在JAVA中设置字体样式和大小?
我想整个段落的格式化文本。我真的很感谢帮助。提前致谢!
下面是我的代码:
public class H_1
{
//--------------------------------------------------------------------
// main
//--------------------------------------------------------------------
public static void main (String[] args)
{
Graphics
// Declare variables
// int someInt;
// double someReal;
// String someString;
Scanner keyboard = new Scanner(System.in); // Connect to keyboard
// Show application header
System.out.println("Welcome to my Application!");
System.out.println("--------------------------\n");
// Display output
System.out.println("I'm singing in the rain");
System.out.println("Just singing in the rain");
System.out.println("What a glorious feelin'");
System.out.println("I'm happy again \n");
System.out.println("I'm laughing at clouds");
System.out.println("So dark up above");
System.out.println("The sun's in my heart");
System.out.println("And I'm ready for love \n");
System.out.println("I walk down the lane");
System.out.println("With a happy refrain");
System.out.println("Just singin',");
System.out.println("Singin' in the rain");
// keyboard.nextInt() reads token from keyboard and converts to whole number
// keyboard.nextDouble() reads token from keyboard and converts to real number
// keyboard.next() reads token from keyboard
// keyboard.nextLine() reads line from keyboard through end-of-line character
// Close keyboard
keyboard.close();
// Show application close
System.out.println("\nEnd of my Application");
}
}
2016-09-12
Emma
+0
你想改变你的文本窗口的字体? –
+0
您的意思是在IDE中为代码编辑格式化字体?这将取决于IDE,并且应该为该IDE记录。 –
cs