javax.swing.GroupLayout Java Examples
The following examples show how to use
javax.swing.GroupLayout.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PostfixStringProcessorUIHandler.java From zap-extensions with Apache License 2.0 | 6 votes |
public PostfixStringProcessorUIPanel() { fieldsPanel = new JPanel(); GroupLayout layout = new GroupLayout(fieldsPanel); fieldsPanel.setLayout(layout); layout.setAutoCreateGaps(true); JLabel valueLabel = new JLabel(VALUE_FIELD_LABEL); valueLabel.setLabelFor(getValueTextField()); layout.setHorizontalGroup( layout.createSequentialGroup() .addComponent(valueLabel) .addComponent(getValueTextField())); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(valueLabel) .addComponent(getValueTextField())); }
Example #2
Source File: IssueTable.java From netbeans with Apache License 2.0 | 6 votes |
private void initComponents(JScrollPane tablePane, FindInQueryBar findBar) { GroupLayout layout = new GroupLayout(component); component.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(findBar, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(tablePane, GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(tablePane, GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE) .addGap(0, 0, 0) .addComponent(findBar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ); }
Example #3
Source File: CssPrepOptionsPanel.java From netbeans with Apache License 2.0 | 6 votes |
private void init() { errorLabel.setText(" "); // NOI18N GroupLayout containerPanelLayout = new GroupLayout(containerPanel); containerPanel.setLayout(containerPanelLayout); GroupLayout.ParallelGroup horizontalGroup = containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING); GroupLayout.SequentialGroup verticalGroup = containerPanelLayout.createSequentialGroup(); containerPanelLayout.setHorizontalGroup(horizontalGroup); containerPanelLayout.setVerticalGroup( containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(verticalGroup) ); for (CssPreprocessorUIImplementation.Options options : allOptions) { JComponent component = options.getComponent(); Parameters.notNull("component", component); // NOI18N horizontalGroup.addComponent(component, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE); verticalGroup.addComponent(component, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED); } }
Example #4
Source File: OperationDescriptionPanel.java From netbeans with Apache License 2.0 | 6 votes |
private GroupLayout.ParallelGroup getVerticalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) { GroupLayout.ParallelGroup res = layout.createParallelGroup (/* XXX huh? GroupLayout.PREFERRED_SIZE*/); GroupLayout.SequentialGroup seq = layout.createSequentialGroup (); if (hasPrimary) { seq.addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 40, 40) .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED) .addComponent (tpPrimaryPlugins, GroupLayout.PREFERRED_SIZE, tpPrimaryPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE) .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED) .addGap (0, 30, 30); } if (hasRequired) { seq.addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 80, 80) .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED) .addComponent (tpDependingPlugins, GroupLayout.PREFERRED_SIZE, tpDependingPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE) .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED); } res.addGroup (seq); return res; }
Example #5
Source File: StockpileDialog.java From jeveassets with GNU General Public License v2.0 | 6 votes |
private void updatePanels() { jFiltersPanel.removeAll(); GroupLayout groupLayout = new GroupLayout(jFiltersPanel); jFiltersPanel.setLayout(groupLayout); groupLayout.setAutoCreateGaps(true); groupLayout.setAutoCreateContainerGaps(false); ParallelGroup horizontalGroup = groupLayout.createParallelGroup(); SequentialGroup verticalGroup = groupLayout.createSequentialGroup(); for (LocationPanel locationPanel : locationPanels) { horizontalGroup.addComponent(locationPanel.getPanel()); verticalGroup.addComponent(locationPanel.getPanel()); } jFiltersPanel.setVisible(!locationPanels.isEmpty()); groupLayout.setHorizontalGroup(horizontalGroup); groupLayout.setVerticalGroup(verticalGroup); autoValidate(); this.getDialog().pack(); }
Example #6
Source File: JournalToolSettingsPanel.java From jeveassets with GNU General Public License v2.0 | 6 votes |
public JournalToolSettingsPanel(final Program program, final SettingsDialog settingsDialog) { super(program, settingsDialog, DialoguesSettings.get().journal(), Images.TOOL_JOURNAL.getIcon()); jSaveHistory = new JCheckBox(DialoguesSettings.get().journalSaveHistory()); JLabelMultiline jSaveHistoryWarning = new JLabelMultiline(DialoguesSettings.get().saveHistoryWarning(), 2); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jSaveHistory) .addComponent(jSaveHistoryWarning, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, Integer.MAX_VALUE) ); layout.setVerticalGroup( layout.createSequentialGroup() .addComponent(jSaveHistory, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) .addComponent(jSaveHistoryWarning, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) ); }
Example #7
Source File: FormLayoutHelper.java From netbeans with Apache License 2.0 | 6 votes |
public FormLayoutHelper(JPanel panel, Column... columns) { this.panel = panel; layout = new GroupLayout(panel); panel.setLayout(layout); horizontalGroup = layout.createSequentialGroup(); verticalGroup = layout.createSequentialGroup(); this.columns = columns; columnGroups = new Group[columns.length]; for (int i = 0; i < columns.length; i++) { Group columnGroup = columns[i].createParallelGroup(layout); columnGroups[i] = columnGroup; horizontalGroup.addGroup(columnGroup); } layout.setHorizontalGroup(horizontalGroup); layout.setVerticalGroup(verticalGroup); }
Example #8
Source File: FuzzerHttpMessageScriptProcessorAdapterUIHandler.java From zap-extensions with Apache License 2.0 | 6 votes |
private void setupFieldsPanel() { GroupLayout layout = new GroupLayout(fieldsPanel); fieldsPanel.setLayout(layout); layout.setAutoCreateGaps(true); JLabel scriptLabel = new JLabel(SCRIPT_FIELD_LABEL); scriptLabel.setLabelFor(scriptComboBox); JScrollPane parametersScrollPane = new JScrollPane(scriptParametersPanel); layout.setHorizontalGroup( layout.createParallelGroup() .addGroup( layout.createSequentialGroup() .addComponent(scriptLabel) .addComponent(scriptComboBox)) .addComponent(parametersScrollPane)); layout.setVerticalGroup( layout.createSequentialGroup() .addGroup( layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(scriptLabel) .addComponent(scriptComboBox)) .addComponent(parametersScrollPane)); }
Example #9
Source File: AdvancedRMScrollablePanel.java From netbeans with Apache License 2.0 | 6 votes |
private void refresh() { GroupLayout panelLayout = (GroupLayout) this.getLayout(); panelLayout.setHorizontalGroup( panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 466, Short.MAX_VALUE) ); panelLayout.setVerticalGroup( panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 201, Short.MAX_VALUE) ); jScrollPane1.setViewportView(panel); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE) ); validate(); }
Example #10
Source File: FormLayoutHelper.java From netbeans with Apache License 2.0 | 5 votes |
@Override protected void addComponent( JComponent component, Group parallelColumnGroup) { parallelColumnGroup.addComponent(component, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE); }
Example #11
Source File: TestingProviderPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { notActiveLabel = new JLabel(); providerPanel = new JPanel(); Mnemonics.setLocalizedText(notActiveLabel, NbBundle.getMessage(TestingProviderPanel.class, "TestingProviderPanel.notActiveLabel.text")); // NOI18N providerPanel.setLayout(new BorderLayout()); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(notActiveLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(0, 0, 0)) ); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(notActiveLabel) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }
Example #12
Source File: DebugWindow.java From mapleLemon with GNU General Public License v2.0 | 5 votes |
private void initComponents() { this.jScrollPane1 = new JScrollPane(); this.jTextArea1 = new JTextArea(); this.jButton1 = new JButton(); this.jLabel1 = new JLabel(); setDefaultCloseOperation(2); setTitle("调试窗口"); setResizable(false); this.jTextArea1.setColumns(20); this.jTextArea1.setLineWrap(true); this.jTextArea1.setRows(5); this.jScrollPane1.setViewportView(this.jTextArea1); this.jButton1.setText("测试封包"); this.jButton1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { DebugWindow.this.jButton1ActionPerformed(evt); } }); GroupLayout layout = new GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(this.jScrollPane1, -1, 446, 32767).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addComponent(this.jLabel1, -1, -1, 32767).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jButton1))).addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(this.jScrollPane1, -1, 253, 32767).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false).addComponent(this.jButton1).addGroup(layout.createSequentialGroup().addGap(0, 0, 0).addComponent(this.jLabel1, -1, -1, 32767))).addContainerGap())); pack(); }
Example #13
Source File: FrameworksPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { scrollCategories = new JScrollPane(); listCategories = new JList<String>(); panelContent = new JPanel(); listCategories.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scrollCategories.setViewportView(listCategories); panelContent.setLayout(new BorderLayout()); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(scrollCategories, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(panelContent, GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE) .addGap(0, 0, 0)) ); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, 0) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(scrollCategories, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) .addComponent(panelContent, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) ); }
Example #14
Source File: TransferSelector.java From netbeans with Apache License 2.0 | 5 votes |
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { treePanel = new JPanel(); checkAllCheckBox = new JCheckBox(); setBorder(BorderFactory.createEtchedBorder()); treePanel.setLayout(new BorderLayout()); Mnemonics.setLocalizedText(checkAllCheckBox, NbBundle.getMessage(TransferSelector.class, "TransferSelector.checkAllCheckBox.text")); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(checkAllCheckBox) .addContainerGap(212, Short.MAX_VALUE)) .addComponent(treePanel, GroupLayout.DEFAULT_SIZE, 310, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, layout.createSequentialGroup() .addComponent(treePanel, GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(checkAllCheckBox)) ); }
Example #15
Source File: SectionPanel.java From netbeans with Apache License 2.0 | 5 votes |
public ActionsBuilder (JPanel panel) { panel.removeAll(); GroupLayout layout = (GroupLayout) panel.getLayout(); horizontalSeqGroup = layout.createSequentialGroup(); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(horizontalSeqGroup) ); verticalParallelGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(verticalParallelGroup) ); }
Example #16
Source File: ChooseBeanInitializer.java From netbeans with Apache License 2.0 | 5 votes |
ChooseBeanPanel() { JLabel nameLabel = new JLabel(NbBundle.getMessage(ChooseBeanInitializer.class, "MSG_Choose_Bean")); // NOI18N nameField = new JTextField(25); GroupLayout layout = new GroupLayout(this); layout.setAutoCreateContainerGaps(true); layout.setAutoCreateGaps(true); setLayout(layout); layout.setHorizontalGroup(layout.createSequentialGroup() .addComponent(nameLabel).addComponent(nameField)); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(nameLabel).addComponent(nameField)); }
Example #17
Source File: Log.java From xnx3 with Apache License 2.0 | 5 votes |
/** * Create the frame. */ public Log() { setBounds(100, 100, 319, 290); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); JScrollPane scrollPane = new JScrollPane(); GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE) ); gl_contentPane.setVerticalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE) ); textArea = new JTextArea(); scrollPane.setViewportView(textArea); textArea.setLineWrap(true); contentPane.setLayout(gl_contentPane); }
Example #18
Source File: FilterSave.java From jeveassets with GNU General Public License v2.0 | 5 votes |
public FilterSave(final Window window) { super(null, GuiShared.get().saveFilter(), window); ListenerClass listener = new ListenerClass(); JLabel jText = new JLabel(GuiShared.get().enterFilterName()); jName = new JComboBox<>(); filters = EventListManager.create(); AutoCompleteSupport.install(jName, EventModels.createSwingThreadProxyList(filters), new Filterator()); jSave = new JButton(GuiShared.get().save()); jSave.setActionCommand(FilterSaveAction.SAVE.name()); jSave.addActionListener(listener); JButton jCancel = new JButton(GuiShared.get().cancel()); jCancel.setActionCommand(FilterSaveAction.CANCEL.name()); jCancel.addActionListener(listener); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jText) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(jName, 220, 220, 220) .addGroup(layout.createSequentialGroup() .addComponent(jSave, Program.getButtonsWidth(), Program.getButtonsWidth(), Program.getButtonsWidth()) .addComponent(jCancel, Program.getButtonsWidth(), Program.getButtonsWidth(), Program.getButtonsWidth()) ) ) ); layout.setVerticalGroup( layout.createSequentialGroup() .addComponent(jText, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) .addComponent(jName, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) .addGroup(layout.createParallelGroup() .addComponent(jSave, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) .addComponent(jCancel, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) ) ); }
Example #19
Source File: BookPanel.java From plugins with GNU General Public License v3.0 | 5 votes |
BookPanel(final Book b) { setBorder(new EmptyBorder(3, 3, 3, 3)); setBackground(ColorScheme.DARK_GRAY_COLOR); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); JLabel image = new JLabel(); b.getIcon().addTo(image); JLabel name = new JLabel(b.getShortName()); location.setFont(FontManager.getRunescapeSmallFont()); layout.setVerticalGroup(layout.createParallelGroup() .addComponent(image) .addGroup(layout.createSequentialGroup() .addComponent(name) .addComponent(location) ) ); layout.setHorizontalGroup(layout.createSequentialGroup() .addComponent(image) .addGap(8) .addGroup(layout.createParallelGroup() .addComponent(name) .addComponent(location) ) ); // AWT's Z order is weird. This put image at the back of the stack setComponentZOrder(image, getComponentCount() - 1); }
Example #20
Source File: WebSocketMessageSelectorPanel.java From zap-extensions with Apache License 2.0 | 5 votes |
public WebSocketMessageSelectorPanel() { panel = new JPanel(); GroupLayout layout = new GroupLayout(panel); panel.setLayout(layout); layout.setAutoCreateGaps(true); JLabel label = new JLabel( Constant.messages.getString( "websocket.fuzzer.select.message.dialogue.warn")); layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(label)); layout.setVerticalGroup(layout.createSequentialGroup().addComponent(label)); }
Example #21
Source File: HttpFuzzerHandlerOptionsPanel.java From zap-extensions with Apache License 2.0 | 5 votes |
public HttpFuzzerHandlerOptionsPanel() { optionsPanel = new JPanel(); followRedirectsCheckBox = new JCheckBox(); JLabel followRedirectsLabel = new JLabel( Constant.messages.getString( "fuzz.httpfuzzer.options.label.followredirects")); followRedirectsLabel.setLabelFor(followRedirectsCheckBox); showRedirectMessagesCheckBox = new JCheckBox(); JLabel showRedirectMessagesLabel = new JLabel( Constant.messages.getString("fuzz.httpfuzzer.options.label.showredirects")); showRedirectMessagesLabel.setLabelFor(showRedirectMessagesCheckBox); GroupLayout layout = new GroupLayout(optionsPanel); optionsPanel.setLayout(layout); layout.setAutoCreateGaps(true); layout.setHorizontalGroup( layout.createSequentialGroup() .addGroup( layout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(followRedirectsLabel)) .addGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(followRedirectsCheckBox))); layout.setVerticalGroup( layout.createSequentialGroup() .addGroup( layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(followRedirectsLabel) .addComponent(followRedirectsCheckBox))); }
Example #22
Source File: JColorTable.java From jeveassets with GNU General Public License v2.0 | 5 votes |
public MyComboBox() { jPanel = new JPanel(); GroupLayout layout = new GroupLayout(jPanel); jPanel.setLayout(layout); layout.setAutoCreateGaps(false); layout.setAutoCreateContainerGaps(false); jDefault = new JNullableLabel(); jDefault.setHorizontalAlignment(JLabel.CENTER); jDefault.setVerticalAlignment(JLabel.CENTER); jDefault.setOpaque(true); jPickerIcon = new JLabel(Images.SETTINGS_COLOR_PICKER.getIcon()); jPickerIcon.setHorizontalTextPosition(JLabel.CENTER); jPickerIcon.setHorizontalAlignment(JLabel.CENTER); jPickerIcon.setVerticalAlignment(JLabel.CENTER); jPickerIcon.setOpaque(true); layout.setHorizontalGroup( layout.createSequentialGroup() .addComponent(jDefault, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, Integer.MAX_VALUE) .addComponent(jPickerIcon, 16, 16, 16) ); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jDefault, 0, 0, Integer.MAX_VALUE) .addComponent(jPickerIcon, 0, 0, Integer.MAX_VALUE) ); }
Example #23
Source File: DependenciesPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * Creates a new {@code DependenciesPanel}. */ public DependenciesPanel() { tableModel = new DependencyTableModel(); initComponents(); table.getSelectionModel().addListSelectionListener(new Listener()); TableCellRenderer versionColumnRenderer = new VersionColumnRenderer(); TableColumnModel tableColumnModel = table.getColumnModel(); tableColumnModel.getColumn(1).setCellRenderer(versionColumnRenderer); tableColumnModel.getColumn(2).setCellRenderer(versionColumnRenderer); tableColumnModel.getColumn(3).setCellRenderer(versionColumnRenderer); GroupLayout layout = (GroupLayout)getLayout(); layout.setHonorsVisibility(dummyButton, false); updateButtons(); }
Example #24
Source File: CSSStylesSelectionPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * Builds the layout of the rendered component. */ private void buildLayout() { GroupLayout layout = new GroupLayout(renderer); GroupLayout.Group hGroup = layout.createSequentialGroup() .addComponent(selectorLabel, 1, 1, Short.MAX_VALUE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup() .addComponent(matchedNodeLabel, 1, 1, Short.MAX_VALUE) .addComponent(ruleLocationPanel, 1, 1, Short.MAX_VALUE) ); GroupLayout.Group vGroup = layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(selectorLabel) .addGroup(layout.createSequentialGroup() .addComponent(matchedNodeLabel) .addComponent(ruleLocationPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) )) .addGap(0, 0, Short.MAX_VALUE); hGroup = layout.createParallelGroup() .addComponent(mediaLabel, 1, 1, Short.MAX_VALUE) .addGroup(hGroup); vGroup = layout.createSequentialGroup() .addComponent(mediaLabel) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(vGroup); layout.setHorizontalGroup(hGroup); layout.setVerticalGroup(vGroup); renderer.setLayout(layout); Color borderColor = UIManager.getColor("Label.background"); // NOI18N renderer.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createMatteBorder(0, 0, 1, 0, borderColor), BorderFactory.createEmptyBorder(2, 2, 2, 2))); }
Example #25
Source File: CssStylesPanelProviderImpl.java From netbeans with Apache License 2.0 | 5 votes |
/** * Initializes the "Run File" panel. */ private void initRunFilePanel() { runFilePanel = new JPanel(); JLabel label = new JLabel(NbBundle.getMessage(CssStylesPanelProviderImpl.class, "CssStylesPanelProviderImpl.runFileLabel")); // NOI18N label.setHorizontalAlignment(SwingConstants.CENTER); runButton = new JButton(); runButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { FileObject lastRelatedFileObject = getLastRelatedFileObject(); if (lastRelatedFileObject != null) { ActionProvider provider = actionProviderForFileObject(lastRelatedFileObject); if (provider != null) { Lookup context = contextForFileObject(lastRelatedFileObject); if (provider.isActionEnabled(ActionProvider.COMMAND_RUN_SINGLE, context)) { provider.invokeAction(ActionProvider.COMMAND_RUN_SINGLE, context); } } } } }); GroupLayout layout = new GroupLayout(runFilePanel); runFilePanel.setLayout(layout); layout.setVerticalGroup(layout.createSequentialGroup() .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(label) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(runButton) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setHorizontalGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER) .addComponent(label, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(runButton)) .addContainerGap()); }
Example #26
Source File: CodeSnifferCustomizerPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { standardLabel = new JLabel(); standardComboBox = new JComboBox<>(); enabledCheckBox = new JCheckBox(); Mnemonics.setLocalizedText(standardLabel, NbBundle.getMessage(CodeSnifferCustomizerPanel.class, "CodeSnifferCustomizerPanel.standardLabel.text")); // NOI18N Mnemonics.setLocalizedText(enabledCheckBox, NbBundle.getMessage(CodeSnifferCustomizerPanel.class, "CodeSnifferCustomizerPanel.enabledCheckBox.text")); // NOI18N GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(standardLabel) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(standardComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(enabledCheckBox) ); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(enabledCheckBox) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(standardLabel) .addComponent(standardComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) ); }
Example #27
Source File: CustomizerJsTesting.java From netbeans with Apache License 2.0 | 5 votes |
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form * Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { providerLabel = new JLabel(); providerComboBox = new JComboBox<JsTestingProvider>(); separator = new JSeparator(); providerPanel = new JPanel(); providerLabel.setLabelFor(providerComboBox); Mnemonics.setLocalizedText(providerLabel, NbBundle.getMessage(CustomizerJsTesting.class, "CustomizerJsTesting.providerLabel.text")); // NOI18N providerPanel.setLayout(new BorderLayout()); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(providerLabel) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(providerComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(separator) ); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(providerLabel) .addComponent(providerComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(separator, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }
Example #28
Source File: AttachmentsPanel.java From netbeans with Apache License 2.0 | 5 votes |
private void switchHelper() { JLabel temp = new JLabel(); GroupLayout layout = (GroupLayout)getLayout(); layout.replace(dummyCreateLabel, temp); layout.replace(createNewButton, dummyCreateLabel); layout.replace(temp, createNewButton); if(attachLogFileButton != null) { layout.replace(dummyAttachLabel, temp); layout.replace(attachLogFileButton, dummyAttachLabel); layout.replace(temp, attachLogFileButton); } }
Example #29
Source File: CodeCompletionPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { autoCompletionSmartQuotesLabel = new JLabel(); autoCompletionSmartQuotesCheckBox = new JCheckBox(); Mnemonics.setLocalizedText(autoCompletionSmartQuotesLabel, NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.autoCompletionSmartQuotesLabel.text")); // NOI18N Mnemonics.setLocalizedText(autoCompletionSmartQuotesCheckBox, NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.autoCompletionSmartQuotesCheckBox.text")); // NOI18N GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(Alignment.LEADING) .addComponent(autoCompletionSmartQuotesLabel) .addComponent(autoCompletionSmartQuotesCheckBox)) .addContainerGap(30, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(autoCompletionSmartQuotesLabel) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(autoCompletionSmartQuotesCheckBox) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); getAccessibleContext().setAccessibleName(NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.AccessibleContext.accessibleName")); // NOI18N getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.AccessibleContext.accessibleDescription")); // NOI18N }
Example #30
Source File: StockpileDialog.java From jeveassets with GNU General Public License v2.0 | 5 votes |
public BorderPanel(String title, Alignment alignment) { this.alignment = alignment; jPanel = new JPanel(); layout = new GroupLayout(jPanel); jPanel.setLayout(layout); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(false); jPanel.setBorder(BorderFactory.createTitledBorder(title)); }