public static void main(String[] args) { // use look and feel for my system (Win32) try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } TextFrame frame = new TextFrame(); // frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("Edit Text"); frame.pack(); // put the frame in the middle of the display Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); frame.setLocation( dim.width / 2 - frame.getSize().width / 2, dim.height / 2 - frame.getSize().height / 2); frame.setVisible(true); }
public static void main(String[] args) { TextFrame tf = new TextFrame("Test", 10, 72, "poggy text"); tf.resize(500, 500); tf.show(); }