List of usage examples for com.jgoodies.forms.layout CellConstraints CellConstraints
public CellConstraints()
From source file:com.projity.print.PageSetup.java
License:Common Public License
private JComponent createScalingPanel() { FormLayout layout = new FormLayout("8dlu, p, 3dlu,30dlu,3dlu,p,3dlu,p,p,p,8dlu", "p, 3dlu,p,10dlu,p,3dlu,p,3dlu"); DefaultFormBuilder builder = new DefaultFormBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(scaleTo, cc.xy(2, 1));//from w w w . ja v a 2 s . c o m builder.add(scaleToWidth, cc.xy(4, 1)); builder.add(scaleToWidthLabel, cc.xy(6, 1)); builder.add(constrainProportions, cc.xy(8, 1)); JLabel l = new JLabel(Messages.getString("PageSetupDialog.Scaling.FitToProportions") + " " + Messages.getString("PageSetupDialog.Scaling.FitToProportions2")); initFont(l); builder.add(scaleToProportions, cc.xy(9, 1)); builder.add(scaleToProportions2, cc.xy(10, 1)); builder.add(scaleToHeight, cc.xy(4, 3)); builder.add(scaleToHeightLabel, cc.xy(6, 3)); builder.add(fitTo, cc.xy(2, 5)); builder.add(fitToWidth, cc.xy(4, 5)); builder.add(fitToWidthLabel, cc.xy(6, 5)); builder.add(fitToHeight, cc.xy(4, 7)); builder.add(fitToHeightLabel, cc.xy(6, 7)); JPanel panel = builder.getPanel(); panel.setBorder(new TitledBorder(Messages.getString("PageSetupDialog.Scaling"))); return panel; }
From source file:com.projity.print.PageSetup.java
License:Common Public License
private JComponent createFlowScalingPanel() { FormLayout layout = new FormLayout("1dlu, 5dlu,p,22dlu,3dlu,p,1dlu", "p, 3dlu,p,3dlu,p,3dlu,p,p,10dlu,p,3dlu,p,3dlu,p,3dlu"); DefaultFormBuilder builder = new DefaultFormBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(scaleTo, cc.xyw(2, 1, 5)); builder.add(scaleToWidth, cc.xyw(3, 3, 2)); builder.add(scaleToWidthLabel, cc.xy(6, 3)); builder.add(scaleToHeight, cc.xyw(3, 5, 2)); builder.add(scaleToHeightLabel, cc.xy(6, 5)); builder.add(constrainProportions, cc.xy(3, 7)); builder.add(scaleToProportions, cc.xyw(4, 7, 3)); builder.add(scaleToProportions2, cc.xyw(4, 8, 4)); builder.add(fitTo, cc.xyw(2, 10, 5)); builder.add(fitToWidth, cc.xyw(3, 12, 2)); builder.add(fitToWidthLabel, cc.xy(6, 12)); builder.add(fitToHeight, cc.xyw(3, 14, 2)); builder.add(fitToHeightLabel, cc.xy(6, 14)); JPanel panel = builder.getPanel(); panel.setBorder(new TitledBorder(Messages.getString("PageSetupDialog.Scaling"))); return panel; }
From source file:com.qspin.qtaste.ui.testcampaign.TestCampaignMainPanel.java
License:Open Source License
public void genUI() { TestCampaignTreeModel model = new TestCampaignTreeModel("Test Campaign"); treeTable = new JTreeTable(model); FormLayout layout = new FormLayout("6px, pref, 6px, pref, 6px, pref, 6px, pref, 6px, pref, 6px:grow", "6px, fill:pref, 6px"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); int colIndex = 2; JLabel label = new JLabel("Campaign:"); saveMetaCampaignButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/save_32")); saveMetaCampaignButton.setToolTipText("Save campaign"); saveMetaCampaignButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (selectedCampaign == null) { logger.warn("No Campaign created"); return; }// ww w. j a va 2 s . c om treeTable.save(selectedCampaign.getFileName(), selectedCampaign.getCampaignName()); } }); addNewMetaCampaignButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/add")); addNewMetaCampaignButton.setToolTipText("Define a new campaign"); addNewMetaCampaignButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String newCampaign = JOptionPane.showInputDialog(null, "New campaign creation:", "Campaign name:", JOptionPane.QUESTION_MESSAGE); if (newCampaign != null && newCampaign.length() > 0) { int index = addTestCampaign(newCampaign); metaCampaignComboBox.setSelectedIndex(index); MetaCampaignFile currentSelectedCampaign = (MetaCampaignFile) metaCampaignComboBox .getSelectedItem(); selectedCampaign = currentSelectedCampaign; if (selectedCampaign != null) { treeTable.save(selectedCampaign.getFileName(), selectedCampaign.getCampaignName()); } metaCampaignComboBox.validate(); metaCampaignComboBox.repaint(); } } }); // get last selected campaign GUIConfiguration guiConfiguration = GUIConfiguration.getInstance(); String lastSelectedCampaign = guiConfiguration.getString(LAST_SELECTED_CAMPAIGN_PROPERTY); // add campaigns found in the list MetaCampaignFile[] campaigns = populateCampaignList(); builder.add(label, cc.xy(colIndex, 2)); colIndex += 2; builder.add(metaCampaignComboBox, cc.xy(colIndex, 2)); colIndex += 2; // add test campaign mouse listener, for the Rename and Remove actions TestcampaignMouseListener testcampaignMouseListener = new TestcampaignMouseListener(); java.awt.Component[] mTestcampaignListComponents = metaCampaignComboBox.getComponents(); for (int i = 0; i < mTestcampaignListComponents.length; i++) { mTestcampaignListComponents[i].addMouseListener(testcampaignMouseListener); } metaCampaignComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { MetaCampaignFile currentSelectedCampaign = (MetaCampaignFile) metaCampaignComboBox .getSelectedItem(); if (currentSelectedCampaign != selectedCampaign) { selectedCampaign = currentSelectedCampaign; if (selectedCampaign != null) { treeTable.removeAll(); if (new File(selectedCampaign.getFileName()).exists()) { treeTable.load(selectedCampaign.getFileName()); } GUIConfiguration guiConfiguration = GUIConfiguration.getInstance(); guiConfiguration.setProperty(LAST_SELECTED_CAMPAIGN_PROPERTY, selectedCampaign.getCampaignName()); try { guiConfiguration.save(); } catch (ConfigurationException ex) { logger.error("Error while saving GUI configuration: " + ex.getMessage(), ex); } } else { treeTable.removeAll(); } } } }); boolean setLastSelectedCampaign = false; if (lastSelectedCampaign != null) { // select last selected campaign for (int i = 0; i < campaigns.length; i++) { if (campaigns[i].getCampaignName().equals(lastSelectedCampaign)) { metaCampaignComboBox.setSelectedIndex(i); setLastSelectedCampaign = true; break; } } } if (!setLastSelectedCampaign && metaCampaignComboBox.getItemCount() > 0) { metaCampaignComboBox.setSelectedIndex(0); } runMetaCampaignButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/running_32")); runMetaCampaignButton.setToolTipText("Run campaign"); runMetaCampaignButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { if (selectedCampaign == null) { logger.warn("No Campaign created"); return; } // first save the current campaign if needed if (treeTable.hasChanged()) { treeTable.save(selectedCampaign.getFileName(), selectedCampaign.getCampaignName()); } // set SUT version TestBedConfiguration.setSUTVersion(parent.getSUTVersion()); testExecutionHandler = new CampaignExecutionThread(selectedCampaign.getFileName()); Thread t = new Thread(testExecutionHandler); t.start(); // set the window to test result // TO DO } catch (Exception ex) { // logger.error(ex.getMessage(), ex); } } }); builder.add(addNewMetaCampaignButton, cc.xy(colIndex, 2)); colIndex += 2; builder.add(saveMetaCampaignButton, cc.xy(colIndex, 2)); colIndex += 2; builder.add(runMetaCampaignButton, cc.xy(colIndex, 2)); colIndex += 2; JScrollPane sp = new JScrollPane(treeTable); this.add(builder.getPanel(), BorderLayout.NORTH); this.add(sp); }
From source file:com.qspin.qtaste.ui.TestCaseInteractivePanel.java
License:Open Source License
public void init() { try {/*from w ww. ja v a 2 s .c o m*/ initIcons(); JPanel topPanel = new JPanel(new BorderLayout()); mStartInteractiveTestButton = new JButton(); mStartInteractiveTestButton.setText("Start Interactive mode"); StartButtonAction startButtonListener = new StartButtonAction(); mStartInteractiveTestButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/running_32")); mStartInteractiveTestButton.addActionListener(startButtonListener); mStopInteractiveTestButton = new JButton(); mStopInteractiveTestButton.setText("Stop Interactive mode"); mStopInteractiveTestButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/stop")); StopInterractiveButtonAction stopButtonListener = new StopInterractiveButtonAction(); mStopInteractiveTestButton.setEnabled(false); mStopInteractiveTestButton.addActionListener(stopButtonListener); FormLayout layout = new FormLayout("6px, pref, 6px, pref, 6px, pref, 6px:grow", "6px, fill:pref, 6px"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(mStartInteractiveTestButton, cc.xy(2, 2)); builder.add(mStopInteractiveTestButton, cc.xy(4, 2)); builder.add(new CommonShortcutsPanel(), cc.xy(6, 2)); JPanel northP = builder.getPanel(); topPanel.add(northP, BorderLayout.PAGE_START); mInteractiveText = new JTextField(); mExecuteButton = new JButton(); mExecuteButton.setText("Execute"); mExecuteButton.setEnabled(false); ExecuteButtonAction executeButtonListener = new ExecuteButtonAction(); mExecuteButton.addActionListener(executeButtonListener); mInteractiveText.addActionListener(executeButtonListener); mInteractiveText.setEnabled(false); topPanel.add(mInteractiveText, BorderLayout.CENTER); topPanel.add(mExecuteButton, BorderLayout.EAST); add(topPanel, BorderLayout.NORTH); log4jPane = new Log4jPanel(); JSplitPane bottomSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); bottomSplitPane.setResizeWeight(0.5); bottomSplitPane.setDividerSize(4); bottomSplitPane.setBottomComponent(log4jPane); mLogPanel.init(); testDataView = new TestDataEditor(true); JSplitPane topSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); topSplitPane.setResizeWeight(0.8); topSplitPane.setDividerSize(4); topSplitPane.setTopComponent(mLogPanel); topSplitPane.setBottomComponent(testDataView); bottomSplitPane.setTopComponent(topSplitPane); this.add(bottomSplitPane); this.apiTree.addTreeSelectionListener(new TCTreeListener()); // initialize testData m_testData = new TestDataInteractive("QTaste_interactive", 1, null, null); m_testData.setGUIMonitoring(true, this); String defaultInstance = null; try { TestBedConfiguration testbedConfig = TestBedConfiguration.getInstance(); if (testbedConfig != null) { defaultInstance = testbedConfig.getDefaultInstanceId(); } } catch (Exception e) { } m_testData.setValue("INSTANCE_ID", defaultInstance); testDataView.setTestData(m_testData); TestBedConfiguration .registerConfigurationChangeHandler(new TestBedConfiguration.ConfigurationChangeHandler() { public void onConfigurationChange() { String defaultInstance = null; try { TestBedConfiguration testbedConfig = TestBedConfiguration.getInstance(); if (testbedConfig != null) { defaultInstance = testbedConfig.getDefaultInstanceId(); } } catch (Exception e) { } try { m_testData.setValue("INSTANCE_ID", defaultInstance); testDataView.setTestData(m_testData); } catch (QTasteDataException ex) { } } }); } catch (QTasteDataException ex) { } }
From source file:com.qspin.qtaste.ui.TestCasePane.java
License:Open Source License
protected void genUI() { executeButton.setMnemonic(KeyEvent.VK_R); saveButton.setMnemonic(KeyEvent.VK_C); startExecutionButton.setMnemonic(KeyEvent.VK_N); tcDocsPane.setEditable(false);/*from w w w. j ava2 s .co m*/ tcDocsPane.setContentType("text/html"); if (tcLogsPane != null) { TextAreaAppender.addTextArea(tcLogsPane); } tcDocsPane.setEditorKit(new HTMLEditorKit()); tcDocsPane.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent e) { } }); ExecuteButtonAction buttonListener = new ExecuteButtonAction(); executeButton.addActionListener(buttonListener); executeButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/running_32")); executeButton.setToolTipText("Run Test(s)"); startExecutionButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/start")); startExecutionButton.setToolTipText("Continue test case execution (F8)"); startExecutionButton.setVisible(false); startExecutionButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { continueDebug(); } }); stepOverExecutionButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/stepover")); stepOverExecutionButton.setToolTipText("Step over the script execution (F6)"); stepOverExecutionButton.setVisible(false); stepOverExecutionButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { continueStep(); } }); stepIntoExecutionButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/stepinto")); stepIntoExecutionButton.setToolTipText("Step into the script execution (F5)"); stepIntoExecutionButton.setVisible(false); stepIntoExecutionButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { continueStepInto(); } }); stopExecutionButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/stop")); stopExecutionButton.setToolTipText("Stop execution"); stopExecutionButton.setVisible(false); stopExecutionButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { stopExecution(); } }); debugButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/debug")); debugButton.setToolTipText("Debug Test(s)"); debugButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { { runTestSuite(true, 1, false); } } }); saveButton.setIcon(ResourceManager.getInstance().getImageIcon("icons/save_32")); saveButton.setToolTipText("Save and check script(s) syntax"); saveButton.setName("save button"); saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (checkScriptsSyntax()) // display dialog when syntax is correct { JOptionPane.showMessageDialog(null, "Syntax checked successfully"); } } }); resultsButton.addActionListener(new ActionListener() { // Show the browser displayed the last test report public void actionPerformed(ActionEvent e) { boolean showTestSuiteReport = resultsPane.getCurrentRunName().equals("Run1"); String resDir = TestEngineConfiguration.getInstance().getString("reporting.generated_report_path"); String baseDir = System.getProperty("user.dir"); String filename = baseDir + File.separator + resDir + File.separator + (showTestSuiteReport ? "index.html" : "campaign.html"); File resultsFile = new File(filename); try { if (Desktop.isDesktopSupported()) { Desktop.getDesktop().open(resultsFile); } else { logger.error("Feature not supported by this platform"); } } catch (IOException ex) { logger.error("Could not open " + filename); } } }); resultsButton.setToolTipText("View the HTML Test Run Summary Results"); resultsButton.setName("test run results button"); FormLayout layout = new FormLayout( "6px, pref, 6px, pref, 6px, pref, 6px, pref, 6px, pref, 6px, pref, 6px, pref, 6px, pref, 6px, pref, 6px:grow", "6px, fill:pref, 6px"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); int rowIndex = 2; int colIndex = 2; builder.add(executeButton, cc.xy(colIndex, rowIndex)); colIndex += 2; builder.add(saveButton, cc.xy(colIndex, rowIndex)); colIndex += 2; builder.add(debugButton, cc.xy(colIndex, rowIndex)); colIndex += 2; builder.add(resultsButton, cc.xy(colIndex, rowIndex)); colIndex += 2; builder.add(new CommonShortcutsPanel(), cc.xy(colIndex, rowIndex)); colIndex += 2; builder.add(startExecutionButton, cc.xy(colIndex, rowIndex)); colIndex += 2; builder.add(stepOverExecutionButton, cc.xy(colIndex, rowIndex)); colIndex += 2; builder.add(stepIntoExecutionButton, cc.xy(colIndex, rowIndex)); colIndex += 2; builder.add(stopExecutionButton, cc.xy(colIndex, rowIndex)); JPanel northP = builder.getPanel(); add(northP, BorderLayout.NORTH); tabbedPane = new JTabbedPane(JTabbedPane.BOTTOM); editorTabbedPane = new JTabbedPane(JTabbedPane.TOP); editorTabbedPane.addMouseListener(new TabMouseListener()); editorTabbedPane.setFocusable(false); sourcePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT); getTcSourcePane().add(editorTabbedPane); sourcePanel.setTopComponent(getTcSourcePane()); sourcePanel.setFocusable(false); sourcePanel.setDividerSize(4); debugPanel = new DebugVariablePanel(); debugPanel.setPreferredSize(new Dimension(100, 150)); sourcePanel.setResizeWeight(0.9); sourcePanel.setBottomComponent(debugPanel); //////////////////////// debugPanel.setVisible(false); //sourcePanel.add(debugPanel, BorderLayout.SOUTH); tabbedPane.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { // transfer focus to editor if necessary if (tabbedPane.getSelectedIndex() == SOURCE_INDEX) { Component tab = editorTabbedPane.getSelectedComponent(); if (tab != null && tab instanceof JScrollPane) { JScrollPane scrollPane = (JScrollPane) tab; tab = scrollPane.getViewport().getView(); if (tab != null) { tab.requestFocusInWindow(); } } } else { Component tab = tabbedPane.getSelectedComponent(); if (tab != null && tab instanceof JScrollPane) { JScrollPane scrollPane = (JScrollPane) tab; tab = scrollPane.getViewport().getView(); if (tab != null) { tab.requestFocusInWindow(); } } } if (!isDocTabSelected()) { return; } // generate doc if necessary NonWrappingTextPane tsPane = getTcSourceTextPane(); if (tsPane != null) { File tsFile = new File(tsPane.getFileName()); PythonTestScript pScript = new PythonTestScript(tsFile, getTestSuiteDirectory()); if (pScript.isDocSynchronized()) { return; } // re-generate the doc parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); pScript.generateDoc(); HTMLDocumentLoader loader = new HTMLDocumentLoader(); HTMLDocument doc; try { File tcDoc = pScript.getTestcaseDoc(); if (tcDoc != null) { doc = loader.loadDocument(tcDoc.toURI().toURL()); setTestCaseInfo(doc); } else { setTestCaseInfo(null); } } catch (MalformedURLException e1) { logger.error(e1); setTestCaseInfo(null); } catch (IOException e1) { logger.error(e1); setTestCaseInfo(null); } parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } }); tabbedPane.add(DOC, new JScrollPane(tcDocsPane)); tabbedPane.add(SOURCE, sourcePanel); tabbedPane.add(RESULTS, resultsPane); if (tcLogsPane != null) { tabbedPane.add(LOGS, tcLogsPane); } add(tabbedPane, BorderLayout.CENTER); }
From source file:com.salas.bb.dialogs.guide.AddGuideDialog.java
License:Open Source License
private synchronized Component getReloadPanel() { if (reloadPanel == null) { String text = Strings.message("click.here.to.load.our.collection.of.interesting.feeds"); String overText = Strings.message("load.our.collection.of.interesting.feeds"); ActionLabel label = new ActionLabel(text, new ReloadAction(), overText); label.setForeground(Color.BLUE); reloadPanel = new JPanel(new FormLayout("pref:grow", "pref:grow")); reloadPanel.add(label, new CellConstraints().xy(1, 1, "c, c")); }//from ww w. j ava2 s . c om return reloadPanel; }
From source file:com.salas.bb.dialogs.InvalidDiscoveryDialog.java
License:Open Source License
private Component buildMainPanel() { FormLayout layout = new FormLayout("7dlu, pref, 2dlu, min:grow", "min:grow, " + "pref, 2dlu, pref, 7dlu, " + "pref, 2dlu, " + "pref, 2dlu, " + "pref, 2dlu, " + "pref, 2dlu, " + "pref, " + "min:grow"); JPanel panel = new JPanel(layout); CellConstraints cc = new CellConstraints(); panel.add(new JLabel(Strings.message("invalid.discovery.wording")), cc.xyw(1, 2, 4)); panel.add(lbLink, cc.xyw(2, 4, 3));/*from ww w. j a v a2 s . c o m*/ panel.add(new JLabel(Strings.message("invalid.discovery.query")), cc.xyw(1, 6, 4)); panel.add(rbNewDiscovery, cc.xy(2, 8)); panel.add(tfNewDiscoveryUrl, cc.xy(4, 8)); panel.add(rbSuggest, cc.xy(2, 10)); panel.add(tfSuggestedUrl, cc.xy(4, 10)); panel.add(rbLeave, cc.xy(2, 12)); panel.add(rbRemove, cc.xy(2, 14)); return panel; }
From source file:com.salas.bb.dialogs.StarzPanel.java
License:Open Source License
/** * Creates a FormLayout and adds the UI components using a PanelBuilder. */// w w w. j av a 2s . c om private void build() { FormLayout layout = new FormLayout("p, right:p, p:grow, right:p:grow", "p, min:grow, p, 2dlu, p, 2dlu, p, 2dlu, p, 2dlu, p: min:grow"); PanelBuilder builder = new PanelBuilder(layout, this); CellConstraints cc = new CellConstraints(); builder.add(whatIsBox, cc.xyw(1, 1, 4)); builder.add(lessImportant, cc.xy(3, 3)); builder.add(moreImportant, cc.xy(4, 3)); builder.add(activity, cc.xy(2, 5)); builder.add(activitySlider, cc.xyw(3, 5, 2)); builder.add(popularitySlider, cc.xyw(3, 7, 2)); builder.add(popularity, cc.xy(2, 7)); builder.add(clickthroughs, cc.xy(2, 9)); builder.add(clickthroughsSlider, cc.xyw(3, 9, 2)); builder.add(feedViews, cc.xy(2, 11)); builder.add(feedViewsSlider, cc.xyw(3, 11, 2)); }
From source file:com.salas.bb.installation.InstallationProgressDialog.java
License:Open Source License
/** * Builds content./*from ww w. j a va 2 s.co m*/ */ protected JComponent buildContent() { FormLayout layout = new FormLayout("15dlu, 150dlu:grow, 15dlu", "100dlu:grow, 2dlu, pref"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(buildStepsPanel(), cc.xy(2, 1)); builder.add(buildButtonBar(), cc.xyw(1, 3, 3)); return builder.getPanel(); }
From source file:com.salas.bb.installation.wizard.LaunchPage.java
License:Open Source License
/** * Builds the panel./* w ww . j a v a2 s . c o m*/ */ private void build(JComponent buttonBar) { buttonBar.setBorder(Borders.createEmptyBorder("6dlu, 6dlu, 6dlu, 6dlu")); FormLayout layout = new FormLayout("15dlu, left:min:grow, 15dlu", "pref, 17dlu, min:grow, 2dlu, pref"); PanelBuilder builder = new PanelBuilder(layout, this); CellConstraints cc = new CellConstraints(); builder.add(buildHeader(), cc.xyw(1, 1, 3)); builder.add(buildTutorialPanel(), cc.xy(2, 3, "f, f")); builder.add(buttonBar, cc.xyw(1, 5, 3)); }