package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import javax.swing.*;
import javax.swing.tree.*;

public class MainPanel extends JPanel {
    private static final String initTxt =
      "Trail: Creating a GUI with JFC/Swing\n" +
      "Lesson: Learning Swing by Example\n" +
      "This lesson explains the concepts you need to use Swing components in building a user interface." +
      " First we examine the simplest Swing application you can write." +
      " Then we present several progressively complicated examples of creating user interfaces using components in the javax.swing package." +
      " We cover several Swing components, such as buttons, labels, and text areas." +
      " The handling of events is also discussed, as are layout management and accessibility." +
      " This lesson ends with a set of questions and exercises so you can test yourself on what you?ve learned.\n" +
      "http://docs.oracle.com/javase/tutorial/uiswing/learn/index.html\n";
    public MainPanel() {
        super(new BorderLayout());

        JTextArea textArea1 = new JTextArea("JTextArea#setMargin(Insets)\n\n" + initTxt);
        textArea1.setMargin(new Insets(5,5,5,5));
        JScrollPane scroll1 = new JScrollPane(textArea1);

        JTextArea textArea2 = new JTextArea("JScrollPane#setViewportBorder(...)\n\n" + initTxt);
        textArea2.setMargin(new Insets(0,0,0,1));
        JScrollPane scroll2 = new JScrollPane(textArea2);
        scroll2.setViewportBorder(BorderFactory.createLineBorder(textArea2.getBackground(), 5));

        JSplitPane sp = new JSplitPane();
        sp.setResizeWeight(.5);
        sp.setLeftComponent(scroll1);
        sp.setRightComponent(scroll2);
        add(sp);

        setPreferredSize(new Dimension(320, 240));
    }
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            @Override public void run() {
                createAndShowGUI();
            }
        });
    }
    public static void createAndShowGUI() {
        try{
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }catch(Exception e) {
            e.printStackTrace();
        }
        JFrame frame = new JFrame("@title@");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.getContentPane().add(new MainPanel());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}

@@ -134,35 +134,8 @@
 g.*;
-%0Aimport javax.swing.tree.*;
 %0A%0Apu
@@ -204,23 +204,24 @@
  String 
-initTxt
+INIT_TXT
  =%0A     
@@ -1143,39 +1143,40 @@
 (Insets)%5Cn%5Cn%22 + 
-initTxt
+INIT_TXT
 );%0A        textA
@@ -1362,15 +1362,16 @@
 %22 + 
-initTxt
+INIT_TXT
 );%0A 
@@ -1596,16 +1596,23 @@
 tPane sp
+litPane
  = new J
@@ -1630,24 +1630,31 @@
 ;%0A        sp
+litPane
 .setResizeWe
@@ -1669,24 +1669,31 @@
 ;%0A        sp
+litPane
 .setLeftComp
@@ -1718,16 +1718,23 @@
       sp
+litPane
 .setRigh
@@ -1768,16 +1768,23 @@
   add(sp
+litPane
 );%0A%0A    
@@ -2173,24 +2173,24 @@
 assName());%0A
-
         %7Dcat
@@ -2192,16 +2192,38 @@
  %7Dcatch(
+UnsupportedLookAndFeel
 Exceptio

Unused imports