Java tutorial
/* * Created by JFormDesigner on Wed Nov 04 12:38:23 EET 2015 */ package Beta; import java.awt.*; import javax.swing.*; import com.jgoodies.forms.factories.*; import com.jgoodies.forms.layout.*; /** * @author unknown */ public class Product extends JFrame { public Product() { initComponents(); } private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Andrey Lubchuck dialogPane = new JPanel(); contentPanel = new JPanel(); scrollPane1 = new JScrollPane(); textPane1 = new JTextPane(); button1 = new JButton(); buttonBar = new JPanel(); okButton = new JButton(); cancelButton = new JButton(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); // JFormDesigner evaluation mark dialogPane.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel .setLayout(new FormLayout("17*(default, $lcgap), default", "6*(default, $lgap), default")); //======== scrollPane1 ======== { scrollPane1.setViewportView(textPane1); } contentPanel.add(scrollPane1, CC.xywh(4, 5, 12, 1)); //---- button1 ---- button1.setText("text"); button1.setMaximumSize(new Dimension(83, 23)); button1.setMinimumSize(new Dimension(83, 23)); contentPanel.add(button1, CC.xywh(21, 11, 11, 1, CC.CENTER, CC.DEFAULT)); } dialogPane.add(contentPanel, BorderLayout.NORTH); //======== buttonBar ======== { buttonBar.setBorder(Borders.createEmptyBorder("5dlu, 0dlu, 0dlu, 0dlu")); buttonBar.setLayout(new FormLayout("$lcgap, default, $glue, $button, $rgap, $button", "pref")); //---- okButton ---- okButton.setText("OK"); buttonBar.add(okButton, CC.xy(4, 1)); //---- cancelButton ---- cancelButton.setText("Cancel"); cancelButton.setMaximumSize(new Dimension(85, 23)); cancelButton.setMinimumSize(new Dimension(85, 23)); buttonBar.add(cancelButton, CC.xy(6, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // Generated using JFormDesigner Evaluation license - Andrey Lubchuck private JPanel dialogPane; private JPanel contentPanel; private JScrollPane scrollPane1; private JTextPane textPane1; private JButton button1; private JPanel buttonBar; private JButton okButton; private JButton cancelButton; // JFormDesigner - End of variables declaration //GEN-END:variables }