public Step2Panel(WizardData wzd) { super(wzd); contentPanel = getContentPanel(wzd); contentPanel.setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); ImageIcon icon = getImageIcon(); titlePanel = new javax.swing.JPanel(); textLabel = new javax.swing.JLabel(); iconLabel = new javax.swing.JLabel(); separator = new javax.swing.JSeparator(); setLayout(new java.awt.BorderLayout()); titlePanel.setLayout(new java.awt.BorderLayout()); titlePanel.setBackground(Color.gray); textLabel.setBackground(Color.gray); textLabel.setFont(new Font("MS Sans Serif", Font.BOLD, 14)); textLabel.setText("Project Language Files"); textLabel.setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); textLabel.setOpaque(true); iconLabel.setBackground(Color.gray); if (icon != null) { iconLabel.setIcon(icon); } titlePanel.add(textLabel, BorderLayout.CENTER); titlePanel.add(iconLabel, BorderLayout.EAST); titlePanel.add(separator, BorderLayout.SOUTH); add(titlePanel, BorderLayout.NORTH); JPanel secondaryPanel = new JPanel(); secondaryPanel.add(contentPanel, BorderLayout.NORTH); add(secondaryPanel, BorderLayout.WEST); }
private JPanel getContentPanel(WizardData wzd) { JPanel contentPanel1 = new JPanel(); welcomeTitle = new JLabel(); contentPanel1.setLayout(new java.awt.BorderLayout()); welcomeTitle.setFont(new java.awt.Font("MS Sans Serif", Font.BOLD, 11)); welcomeTitle.setText("Please insert already existing language files!"); contentPanel1.add(welcomeTitle, BorderLayout.NORTH); // ------------------------------------------------------------------------ Container mainPanel = new JPanel(); SpringLayout layout = new SpringLayout(); mainPanel.setLayout(layout); JTextArea infoText = new JTextArea(); infoText.setLineWrap(false); infoText.setEditable(false); infoText.setFocusable(false); infoText.setBackground(mainPanel.getBackground()); infoText.append(TInfoText.runtime.getText("newwizard", "site2")); JDialog parent = null; if (wzd.getWizard() != null) { parent = wzd.getWizard().getDialog(); } table = new LanguageManagerPanel(TGlobal.projects.getCurrentProject(), parent, true); rescanButton.addActionListener(this); baseButton.addActionListener(this); // Create and add the components. mainPanel.add(infoText); mainPanel.add(baseLabel); mainPanel.add(baseField); mainPanel.add(baseButton); mainPanel.add(rescanButton); mainPanel.add(table); // infoText layout.putConstraint(SpringLayout.WEST, infoText, 5, SpringLayout.WEST, mainPanel); layout.putConstraint(SpringLayout.NORTH, infoText, 5, SpringLayout.NORTH, mainPanel); // baseLabel ------------------------------------------------------------- layout.putConstraint(SpringLayout.WEST, baseLabel, 0, SpringLayout.WEST, infoText); layout.putConstraint(SpringLayout.NORTH, baseLabel, 12, SpringLayout.SOUTH, infoText); // nameField layout.putConstraint(SpringLayout.WEST, baseField, 5, SpringLayout.EAST, baseLabel); layout.putConstraint(SpringLayout.NORTH, baseField, 10, SpringLayout.SOUTH, infoText); // baseButton layout.putConstraint(SpringLayout.WEST, baseButton, 5, SpringLayout.EAST, baseField); layout.putConstraint(SpringLayout.NORTH, baseButton, 7, SpringLayout.SOUTH, infoText); // rescanButton layout.putConstraint(SpringLayout.WEST, rescanButton, 5, SpringLayout.EAST, baseButton); layout.putConstraint(SpringLayout.NORTH, rescanButton, 7, SpringLayout.SOUTH, infoText); // table layout.putConstraint(SpringLayout.WEST, table, 5, SpringLayout.WEST, mainPanel); layout.putConstraint(SpringLayout.NORTH, table, 15, SpringLayout.SOUTH, baseField); // panel edges ------------------------------------------------------ layout.putConstraint(SpringLayout.EAST, mainPanel, 5, SpringLayout.EAST, infoText); layout.putConstraint(SpringLayout.SOUTH, mainPanel, 5, SpringLayout.SOUTH, table); layout.layoutContainer(mainPanel); contentPanel1.add(mainPanel, BorderLayout.CENTER); return contentPanel1; }