import javax.imageio.*; import java.awt.image.*; import java.awt.event.*; import java.awt.*; import java.security.NoSuchAlgorithmException; import java.security.MessageDigest; import java.lang.management.*; import java.lang.reflect.*; import java.net.*; import java.io.*; import javax.swing.text.*; import javax.swing.event.*; import javax.swing.*; import java.util.concurrent.atomic.*; import java.util.concurrent.*; import java.util.regex.*; import java.util.List; import java.util.zip.*; import java.util.*; public class main { static int size = 25; public static void main(String[] args) throws Exception { showText_fontSize("Font size: " + size, "Hello\nworld", size); } static void showText_fontSize(String title, String text, int fontSize) { JTextArea textArea = new JTextArea(text); textArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, fontSize)); makeFrame(title, new JScrollPane(textArea)); } static void makeFrame(Component content) { // TODO: get program ID makeFrame("A JavaX Frame", content); } static void makeFrame(String title, Component content) { JFrame frame = new JFrame(title); frame.getContentPane().add(content); frame.setBounds(300, 100, 500, 400); frame.setVisible(true); exitOnFrameClose(frame); } static void exitOnFrameClose(JFrame frame) { frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }