import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; class MVCExample extends JFrame { MVCExample(){ super(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(750, 100); setTitle("MVCExample"); JTextField tf1 = new JTextField(10); Document document = tf1.getDocument(); JTextField tf2 = new JTextField(document,null,10); Container c = this.getContentPane(); c.setLayout(new FlowLayout()); c.add( tf1 ); c.add( tf2 ); DocumentSizeView dsv = new DocumentSizeView( document ); c.add( dsv ); dsv.setFont( new Font("Serif",Font.PLAIN,32) ); new Thread( new InsertHaHa( document ) ).start(); tf1.setFont( new Font("Serif",Font.ITALIC,32) ); tf2.setFont( new Font("Serif",Font.BOLD,32) ); setVisible(true); setAlwaysOnTop(true); setAlwaysOnTop(false); } public static void main(String[] a){ new MVCExample(); } }