/* * [TestJScrollPane.java] * * Summary: demonstrate the use of javax.swing.JScrollPane. * * Copyright: (c) 2011-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2011-09-20 initial version */ package com.mindprod.example; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.SwingUtilities; import java.awt.Container; import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentListener; /** * demonstrate the use of javax.swing.JScrollPane. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2011-09-20 initial version * @since 2011-09-20 */ public final class TestJScrollPane { /** * is user busy with the scroller? */ private static boolean userBusyScrolling; /** * Debugging harness for a Frame * * @param args command line arguments are ignored. */ public static void main( String args[] ) { SwingUtilities.invokeLater( new Runnable() { /** * fire up a JFrame on the Swing thread */ public void run() { final JFrame jFrame = new JFrame(); final Container contentPane = jFrame.getContentPane(); // The user hitting enter inserts a \n character into the text. final JEditorPane jEditorPane = new JEditorPane(); jEditorPane.setContentType( "text/html" ); jEditorPane.setEditable( false ); jEditorPane.setText( "
The destructive Seven Blunders of the World that cause " + "violence:\n" + "