List of usage examples for com.jgoodies.forms.layout CellConstraints CellConstraints
public CellConstraints()
From source file:com.aw.swing.mvp.cmp.pick.FrmPickMovAlm.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL/*from w w w .j a v a2 s . co m*/ */ private void $$$setupUI$$$() { createUIComponents(); pnlMain = new JPanel(); pnlMain.setLayout(new FormLayout( "left:25dlu:noGrow,fill:52dlu:noGrow,left:8dlu:noGrow,fill:43dlu:noGrow,left:10dlu:noGrow,fill:13px:noGrow,left:19dlu:noGrow,fill:8px:noGrow,left:56dlu:noGrow,fill:10px:noGrow,fill:50dlu:noGrow,left:22dlu:noGrow", "center:12dlu:noGrow,top:4dlu:noGrow,center:12dlu:noGrow,top:5dlu:noGrow,center:12dlu:noGrow,top:3dlu:noGrow,center:18px:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:149dlu:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:max(d;4dlu):noGrow,center:12dlu:noGrow")); pnlMain.setMinimumSize(new Dimension(501, 425)); pnlMain.setOpaque(true); pnlMain.setPreferredSize(new Dimension(501, 425)); lblSearch = new JLabel(); lblSearch.setText("Descripcin"); lblSearch.setDisplayedMnemonic('D'); lblSearch.setDisplayedMnemonicIndex(0); CellConstraints cc = new CellConstraints(); pnlMain.add(lblSearch, cc.xyw(1, 3, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT)); btnSearch = new JButton(); btnSearch.setText("Buscar"); btnSearch.setMnemonic('B'); btnSearch.setDisplayedMnemonicIndex(0); pnlMain.add(btnSearch, cc.xy(11, 3)); footerPanel.setLayout( new FormLayout("fill:73dlu:noGrow,left:191dlu:noGrow,fill:48dlu:noGrow", "center:12dlu:noGrow")); pnlMain.add(footerPanel, cc.xyw(1, 14, 12, CellConstraints.DEFAULT, CellConstraints.FILL)); lblF10 = new JLabel(); lblF10.setText(" [F10] Aceptar"); footerPanel.add(lblF10, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); lblEsc = new JLabel(); lblEsc.setText(" [Esc] Salir"); footerPanel.add(lblEsc, cc.xy(3, 1)); sepCriterioBusqueda.setSeparatorTitle("Criterio de Bsqueda"); pnlMain.add(sepCriterioBusqueda, cc.xyw(1, 1, 12, CellConstraints.FILL, CellConstraints.FILL)); pnlTitGrid.setLayout( new FormLayout("fill:204dlu:noGrow,left:88dlu:noGrow,fill:15dlu:noGrow", "center:12dlu:noGrow")); pnlMain.add(pnlTitGrid, cc.xyw(1, 9, 12, CellConstraints.FILL, CellConstraints.FILL)); lblTitGrid = new JLabel(); lblTitGrid.setText(" Relacin :"); lblTitGrid.setDisplayedMnemonic('R'); lblTitGrid.setDisplayedMnemonicIndex(1); pnlTitGrid.add(lblTitGrid, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); chkSel = new JCheckBox(); chkSel.setBackground(new Color(-16747105)); chkSel.setText(""); pnlTitGrid.add(chkSel, cc.xy(3, 1)); final JScrollPane scrollPane1 = new JScrollPane(); scrollPane1.setMinimumSize(new Dimension(454, 418)); pnlMain.add(scrollPane1, cc.xyw(1, 10, 12, CellConstraints.FILL, CellConstraints.FILL)); tblGrid = new JTable(); tblGrid.setMinimumSize(new Dimension(450, 400)); scrollPane1.setViewportView(tblGrid); final JLabel label1 = new JLabel(); label1.setText(" Nmero de Registros:"); pnlMain.add(label1, cc.xyw(1, 12, 3)); lblNumRegistros = new JLabel(); lblNumRegistros.setText("Label"); pnlMain.add(lblNumRegistros, cc.xyw(4, 12, 7)); txtSearch = new JTextField(); pnlMain.add(txtSearch, cc.xyw(4, 3, 6, CellConstraints.FILL, CellConstraints.DEFAULT)); lblSearch2 = new JLabel(); lblSearch2.setText("Descripcin2"); lblSearch2.setDisplayedMnemonic('D'); lblSearch2.setDisplayedMnemonicIndex(0); pnlMain.add(lblSearch2, cc.xyw(1, 7, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT)); cmbAlmacen = new JComboBox(); pnlMain.add(cmbAlmacen, cc.xyw(4, 7, 6)); lblFecIni = new JLabel(); lblFecIni.setText("Fecha del"); pnlMain.add(lblFecIni, cc.xyw(1, 5, 2, CellConstraints.RIGHT, CellConstraints.CENTER)); txtFecIni = new JTextField(); pnlMain.add(txtFecIni, cc.xyw(4, 5, 3, CellConstraints.FILL, CellConstraints.DEFAULT)); lblFecFin = new JLabel(); lblFecFin.setText("al"); pnlMain.add(lblFecFin, cc.xy(7, 5, CellConstraints.RIGHT, CellConstraints.CENTER)); txtFecFin = new JTextField(); pnlMain.add(txtFecFin, cc.xy(9, 5, CellConstraints.FILL, CellConstraints.DEFAULT)); lblSearch.setLabelFor(txtSearch); lblSearch2.setLabelFor(txtSearch); lblFecIni.setLabelFor(txtSearch); lblFecFin.setLabelFor(txtSearch); }
From source file:com.aw.swing.mvp.grid.GridManager.java
License:Open Source License
private void configureGridTitleColor() { JPanel pnlGrid = ipView.getPnlGrid(gridIndex); pnlGrid.setBorder(BorderFactory.createLineBorder(new Color(131, 172, 219))); JPanel pnlTitGrid = ipView.getPnlTitGrid(gridIndex); pnlTitGrid.setBackground(new Color(131, 172, 219)); pnlTitGrid.setLayout(/* w ww. j a v a 2 s . c o m*/ new FormLayout("fill:16dlu:noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,right:pref:grow", "center:16dlu:noGrow")); JLabel lblTitGrid = ipView.getLblTitGrid(gridIndex); lblTitGrid.setFont(new Font(lblTitGrid.getFont().getName(), Font.BOLD, 14)); lblTitGrid.setForeground(Color.black); numRecords = new JLabel(""); numRecords.setFont(new Font(lblTitGrid.getFont().getName(), Font.BOLD, 14)); numRecords.setForeground(Color.black); numRecords.setVisible(showTotalRegistros); pnlTitGrid.remove(lblTitGrid); CellConstraints cc = new CellConstraints(); pnlTitGrid.add(lblTitGrid, cc.xy(3, 1)); pnlTitGrid.add(numRecords, cc.xy(5, 1)); }
From source file:com.aw.swing.mvp.ui.FormLayout.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL/*from ww w. jav a 2 s .co m*/ */ private void $$$setupUI$$$() { createUIComponents(); mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout(0, 0)); mainPanel.setPreferredSize(new Dimension(600, 400)); mainPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), null)); contentPanel = new JPanel(); contentPanel.setLayout(new com.jgoodies.forms.layout.FormLayout( "fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:max(d;4px):noGrow")); mainPanel.add(contentPanel, BorderLayout.CENTER); contentPanel .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10), null)); headerPanel = new JPanel(); headerPanel.setLayout(new com.jgoodies.forms.layout.FormLayout("fill:d:grow", "center:52px:noGrow,center:max(d;4px):noGrow")); headerPanel.setPreferredSize(new Dimension(0, 74)); mainPanel.add(headerPanel, BorderLayout.NORTH); titlePanel.setLayout(new BorderLayout(0, 0)); titlePanel.setBackground(new Color(-1)); titlePanel.setMinimumSize(new Dimension(0, 50)); titlePanel.setPreferredSize(new Dimension(0, 60)); CellConstraints cc = new CellConstraints(); headerPanel.add(titlePanel, cc.xy(1, 1)); titlePanel.add(formTitle, BorderLayout.CENTER); errorPanel.setLayout(new com.jgoodies.forms.layout.FormLayout("fill:d:grow", "center:d:grow")); errorPanel.setBackground(new Color(-52378)); errorPanel.setPreferredSize(new Dimension(0, 30)); headerPanel.add(errorPanel, cc.xy(1, 2)); lblErrorMessage.setFont( new Font(lblErrorMessage.getFont().getName(), Font.BOLD, lblErrorMessage.getFont().getSize())); lblErrorMessage.setForeground(new Color(-1)); lblErrorMessage.setHorizontalAlignment(2); lblErrorMessage.setHorizontalTextPosition(11); lblErrorMessage.setMinimumSize(new Dimension(128, 18)); lblErrorMessage.setText("El campo es requerido"); errorPanel.add(lblErrorMessage, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); }
From source file:com.aw.swing.mvp.ui.painter.ErrorBorderPainter.java
License:Open Source License
public void paintError(List components) { clearError(components);/*from w w w . ja va 2s . co m*/ for (Iterator iterator = components.iterator(); iterator.hasNext();) { BindingComponent bindingComponent = (BindingComponent) iterator.next(); JLabel label = (JLabel) ((JComponent) bindingComponent.getJComponent()) .getClientProperty(BindingComponent.ATTR_ICONO); if (label != null) { return; } logger.debug("creating icon for " + bindingComponent.getFieldName()); JComponent feedbackComponent = createFeedbackComponent(); if (feedbackComponent == null) { return; } Container container = bindingComponent.getJComponent().getParent(); // GMC Todo ver q pasa cuando no se envia null -> Ver como manejar este caso para los diferentes layouts // container.add(feedbackComponent, null); CellConstraints cc = new CellConstraints(); container.add(feedbackComponent, cc.xy(1, 1)); Point overlayPosition = getFeedbackComponentOrigin(feedbackComponent, bindingComponent.getJComponent()); overlayPosition.translate(-3, +2); feedbackComponent.setLocation(overlayPosition); FormLayout layout = ((FormLayout) container.getLayout()); CellConstraints cc1 = layout.getConstraints(bindingComponent.getJComponent()); container.add(feedbackComponent, cc1.xy(cc1.gridX - 1, cc1.gridY + 1, CellConstraints.RIGHT, CellConstraints.BOTTOM)); bindingComponent.getJComponent().putClientProperty(BindingComponent.ATTR_ICONO, feedbackComponent); } }
From source file:com.brainflow.application.toplevel.Brainflow.java
private IImageDataSource specialHandling(IImageDataSource dataSource) { if (dataSource.getFileFormat().equals("Analyze7.5")) { JPanel panel = new JPanel(); JLabel messageLabel = new JLabel("Please select correct image orientation from menu: "); java.util.List<Anatomy3D> choices = Anatomy3D.getInstanceList(); JComboBox choiceBox = new JComboBox(choices.toArray()); //todo hackery alert Anatomy anatomy = dataSource.getImageInfo().getAnatomy(); choiceBox.setSelectedItem(anatomy); FormLayout layout = new FormLayout("4dlu, l:p, p:g, 4dlu", "6dlu, p, 10dlu, p, 6dlu"); CellConstraints cc = new CellConstraints(); panel.setLayout(layout);//w w w . j a va 2s .c o m panel.add(messageLabel, cc.xyw(2, 2, 2)); panel.add(choiceBox, cc.xyw(2, 4, 2)); JOptionPane.showMessageDialog(brainFrame, panel, "Analyze 7.5 image format ...", JOptionPane.WARNING_MESSAGE); Anatomy selectedAnatomy = (Anatomy) choiceBox.getSelectedItem(); if (selectedAnatomy != anatomy) { //todo hackery alert dataSource.getImageInfo().setAnatomy((Anatomy3D) selectedAnatomy); dataSource.releaseData(); } } return dataSource; }
From source file:com.devdaily.heidi.ApplyLicenseDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents dialogPane = new JPanel(); contentPanel = new JPanel(); headerTitle = new JLabel(); headerHelpText = new JLabel(); fileTextfieldLabel = new JLabel(); fileTextField = new JTextField(); browseButton = new JButton(); //// w ww . j ava2 s .co m // AJA // //needALicenseLabel = new JLabel(); buttonBar = new JPanel(); cancelButton = new JButton(); applyLicenseButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== // // AJA // setTitle("Hyde Licensing"); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.PARAGRAPH_GAP_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.PARAGRAPH_GAP_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.PARAGRAPH_GAP_ROWSPEC })); //---- headerTitle ---- headerTitle.setText("Licensing"); headerTitle.setFont(new Font("Lucida Grande", Font.BOLD, 14)); contentPanel.add(headerTitle, cc.xywh(1, 1, 5, 1)); //---- headerHelpText ---- headerHelpText.setText("Select the license file from your system, and click \"Apply License\"."); contentPanel.add(headerHelpText, cc.xywh(1, 3, 5, 1)); //---- fileTextfieldLabel ---- fileTextfieldLabel.setText("Choose license file:"); contentPanel.add(fileTextfieldLabel, cc.xywh(1, 7, 5, 1)); contentPanel.add(fileTextField, cc.xywh(1, 9, 4, 1)); //---- browseButton ---- browseButton.setText("Browse..."); contentPanel.add(browseButton, cc.xy(5, 9)); //---- needALicenseLabel ---- // // AJA // //needALicenseLabel.setText("Need a license? Click here to get started."); needALicenseLabel.setForeground(Color.gray); contentPanel.add(needALicenseLabel, cc.xywh(1, 13, 5, 1)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout(new FormLayout(new ColumnSpec[] { FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC, FormFactory.MIN_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- cancelButton ---- cancelButton.setText("Cancel"); buttonBar.add(cancelButton, cc.xy(4, 1)); //---- applyLicenseButton ---- applyLicenseButton.setText("Apply License"); buttonBar.add(applyLicenseButton, 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 }
From source file:com.devdaily.heidi.LicenseReminderDialog.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents dialogPane = new JPanel(); contentPanel = new JPanel(); htmlMessageScrollPane = new JScrollPane(); htmlMessageArea = new JEditorPane(); closeButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {// w w w.j a v a 2 s .c om dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel .setLayout( new FormLayout( new ColumnSpec[] { FormFactory.GLUE_COLSPEC, new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW), new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), new ColumnSpec(Sizes.dluX(0)), FormFactory.GLUE_COLSPEC }, new RowSpec[] { FormFactory.LINE_GAP_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //======== htmlMessageScrollPane ======== { //---- htmlMessageArea ---- htmlMessageArea.setContentType("text/html"); htmlMessageArea.setEditable(false); htmlMessageArea.setFont(new Font("Monaco", Font.PLAIN, 13)); htmlMessageArea.setMargin(new Insets(4, 4, 4, 4)); htmlMessageArea.setMinimumSize(new Dimension(360, 240)); htmlMessageArea.setPreferredSize(new Dimension(360, 240)); htmlMessageScrollPane.setViewportView(htmlMessageArea); } contentPanel.add(htmlMessageScrollPane, cc.xy(3, 3)); //---- closeButton ---- closeButton.setText("Close"); contentPanel.add(closeButton, cc.xywh(3, 5, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); } dialogPane.add(contentPanel, BorderLayout.CENTER); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.devdaily.justwrite.view.ColorChooserDialog.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents dialogPane = new JPanel(); contentPanel = new JPanel(); fontColorSwatch = new JLabel(); fontColorLabel = new JLabel(); backgroundColorSwatch = new JLabel(); backgroundColorLabel = new JLabel(); textAreaScrollPane = new JScrollPane(); sampleTextArea = new JTextPane(); buttonBar = new JPanel(); resetButton = new JButton(); okButton = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle("Modify the Editor Colors"); setResizable(false);// w ww . ja v a 2s . c o m Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setPreferredSize(new Dimension(388, 237)); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.UNRELATED_GAP_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.PARAGRAPH_GAP_ROWSPEC, new RowSpec(RowSpec.CENTER, Sizes.PREFERRED, FormSpec.DEFAULT_GROW), FormFactory.PARAGRAPH_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- fontColorSwatch ---- fontColorSwatch.setPreferredSize(new Dimension(60, 20)); fontColorSwatch.setForeground(Color.green); fontColorSwatch.setBackground(Color.green); fontColorSwatch.setOpaque(true); fontColorSwatch.setBorder(new EtchedBorder()); fontColorSwatch.setToolTipText("Click to change the font color"); contentPanel.add(fontColorSwatch, cc.xy(3, 3)); //---- fontColorLabel ---- fontColorLabel.setText("Font Color"); fontColorLabel.setToolTipText("Click to change the font color"); contentPanel.add(fontColorLabel, cc.xy(5, 3)); //---- backgroundColorSwatch ---- backgroundColorSwatch.setPreferredSize(new Dimension(60, 20)); backgroundColorSwatch.setBackground(Color.black); backgroundColorSwatch.setOpaque(true); backgroundColorSwatch.setBorder(new MatteBorder(1, 1, 1, 1, Color.black)); backgroundColorSwatch.setToolTipText("Click to change the background color"); contentPanel.add(backgroundColorSwatch, cc.xy(3, 5)); //---- backgroundColorLabel ---- backgroundColorLabel.setText("Background Color"); backgroundColorLabel.setToolTipText("Click to change the background color"); contentPanel.add(backgroundColorLabel, cc.xy(5, 5)); //======== textAreaScrollPane ======== { textAreaScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); textAreaScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); textAreaScrollPane.setToolTipText("This is an example of your colors with the current font."); textAreaScrollPane.setPreferredSize(new Dimension(300, 60)); //---- sampleTextArea ---- sampleTextArea.setText("Four score and seven years ago"); sampleTextArea.setEditable(false); sampleTextArea.setPreferredSize(new Dimension(200, 60)); sampleTextArea.setToolTipText("Sample area to demonstrate your color choices"); textAreaScrollPane.setViewportView(sampleTextArea); } contentPanel.add(textAreaScrollPane, cc.xywh(3, 7, 3, 2)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- resetButton ---- resetButton.setText("Reset"); resetButton.setToolTipText("Reset to the system default colors"); buttonBar.add(resetButton, cc.xy(2, 1)); //---- okButton ---- okButton.setText("OK"); okButton.setToolTipText("Accept your color changes"); buttonBar.add(okButton, cc.xy(4, 1)); //---- cancelButton ---- cancelButton.setText("Cancel"); cancelButton.setToolTipText("Cancel your color changes"); 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 }
From source file:com.devdaily.justwrite.view.FullScreenEditorFrame.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents scrollPane = new JScrollPane(); // NEW - this was a JTextPane DocumentLookAhead lookAhead = new DocumentLookAhead(); editorPane = new LookAheadTextPane(lookAhead); CellConstraints cc = new CellConstraints(); //======== this ======== setBackground(Color.black);/*from ww w .j a v a2 s. com*/ Container contentPane = getContentPane(); contentPane.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, 0.30000000000000004), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("660px"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, 0.30000000000000004) }, new RowSpec[] { // NEW new RowSpec("96px"), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec("60px") })); //======== scrollPane ======== { scrollPane.setBackground(Color.black); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane.setAutoscrolls(true); scrollPane.setBorder(null); scrollPane.setFocusable(false); scrollPane.setRequestFocusEnabled(false); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setViewportBorder(null); //---- editorPane ---- editorPane.setBackground(new Color(12, 12, 12)); editorPane.setForeground(Color.green); editorPane.setFont(new Font("Monaco", Font.PLAIN, 13)); editorPane.setCaretColor(Color.green); editorPane.setSelectedTextColor(Color.green); editorPane.setBorder(null); editorPane.setSelectionColor(Color.darkGray); scrollPane.setViewportView(editorPane); } contentPane.add(scrollPane, cc.xy(3, 3)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.devdaily.justwrite.view.OpenRecentFileDialog.java
License:Open Source License
private void doLayoutForm() { FormLayout layout = new FormLayout("fill:pref, 3dlu, fill:80dlu:grow, 3dlu, left:pref", "pref, 6dlu, pref, 6dlu, pref"); JPanel panel = new JPanel(); DefaultFormBuilder builder = new DefaultFormBuilder(layout, panel); builder.setDefaultDialogBorder();//w ww. j a v a 2s.com CellConstraints cc = new CellConstraints(); builder.addSeparator("Recent Files", cc.xyw(1, 1, 5)); builder.add(scrollPane, cc.xyw(1, 3, 5)); builder.add(ButtonBarFactory.buildCenteredBar(cancelButton, okButton), cc.xy(3, 5, CellConstraints.CENTER, CellConstraints.DEFAULT)); //builder.add(okButton, cc.xy(3,5,CellConstraints.CENTER, CellConstraints.DEFAULT)); this.setContentPane(builder.getPanel()); }