mainLayout.setHgap(hGap); mainLayout.setVgap(vGap); buttonLayout.setHgap(hGap); gui.setBorder(new EmptyBorder(vBorder,hBorder,vBorder,hBorder)); Container c = gui.getTopLevelAncestor();
centerFrame.setBorder(new LineBorder(Color.BLUE, 6)); FlowLayout flow = (FlowLayout)centerFrame.getLayout(); flow.setHgap(0); flow.setVgap(0);
@ScriptFunction public void setHgap(int aValue) { ((FlowLayout) super.getLayout()).setHgap(aValue); super.revalidate(); super.repaint(); }
private JPanel getPanelTitle() { if (panelTitle == null) { final FlowLayout flowLayout = new FlowLayout(); flowLayout.setHgap(10); flowLayout.setAlignment(FlowLayout.LEFT); flowLayout.setVgap(10); panelTitle = new JPanel(); panelTitle.setLayout(flowLayout); panelTitle.setPreferredSize(new Dimension(40, 30)); panelTitle.add(getLabelTitle(), null); } return panelTitle; }
private JPanel getButtonPanel() { if (panelButtons == null) { final FlowLayout flowLayout = new FlowLayout(); flowLayout.setHgap(10); flowLayout.setVgap(10); panelButtons = new JPanel(); panelButtons.setLayout(flowLayout); panelButtons.setPreferredSize(new Dimension(100, 50)); panelButtons.setName("buttonPanel"); panelButtons.add(getButtonCancel(), null); } return panelButtons; }
/** * Creates the Dialog and returns the Result * @param MessageOption that was pressed */ private int showConfirmDialog() { JTextField tf = new JTextField(); JPanel calPanel = new JPanel(); FlowLayout layout = new FlowLayout(); layout.setAlignment(FlowLayout.LEFT); layout.setHgap(0); layout.setVgap(0); calPanel.setLayout(layout); calPanel.add(_calendarBox); Object[] msg = { _message, calPanel }; int result = JOptionPane.showConfirmDialog(_parentComponent, msg, _title, _optionType, _messageType); return result; } }
public JPanel getRow(String row) { if (row == null) { row = "a1"; } if (row.equals(CommandMenuItems.CUSTOM_COMMANDS_SUBMENU)) { row = "b1"; } if (!rows.containsKey(row)) { JPanel newRow = new JPanel(); ((FlowLayout)(newRow.getLayout())).setVgap(4); // This should be default, but just to be clear ((FlowLayout)(newRow.getLayout())).setHgap(5); if (row.startsWith("a")) { primary.add(newRow); } else { secondary.add(newRow); } rows.put(row, newRow); } return rows.get(row); }
private JPanel getPanelButtons() { if (panelButtons == null) { final FlowLayout flowLayout2 = new FlowLayout(); flowLayout2.setAlignment(FlowLayout.RIGHT); flowLayout2.setVgap(10); flowLayout2.setHgap(10); panelButtons = new JPanel(); panelButtons.setLayout(flowLayout2); panelButtons.setPreferredSize(new Dimension(200, 45)); panelButtons.add(getCheckBoxIncludeSubdirs(), null); panelButtons.add(getButtonCancel(), null); panelButtons.add(getButtonOK(), null); } return panelButtons; }
/** * Return the CloseButtonPanelFlowLayout property value. * @return java.awt.FlowLayout */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private java.awt.FlowLayout getCloseButtonPanelFlowLayout() { java.awt.FlowLayout ivjCloseButtonPanelFlowLayout = null; try { /* Create part */ ivjCloseButtonPanelFlowLayout = new java.awt.FlowLayout(); ivjCloseButtonPanelFlowLayout.setAlignment(java.awt.FlowLayout.RIGHT); ivjCloseButtonPanelFlowLayout.setHgap(10); } catch (java.lang.Throwable ivjExc) { handleException(ivjExc); }; return ivjCloseButtonPanelFlowLayout; } /**
/** * Constructor. * * @param label fixed label text */ public JLabelledValue(String label) { FlowLayout flowLayout = (FlowLayout) getLayout(); flowLayout.setAlignment(FlowLayout.LEFT); flowLayout.setVgap(0); flowLayout.setHgap(0); JLabel textLabel = new JLabel(label); textLabel.setFont(new Font("Tahoma", Font.BOLD, 11)); textLabel.setPreferredSize(new Dimension(70, 14)); add(textLabel); m_valueLabel = new JLabel(""); m_valueLabel.setPreferredSize(new Dimension(80, 14)); add(m_valueLabel); }
/** * Constructor. * * @param label fixed label text */ public JLabelledValue(String label) { FlowLayout flowLayout = (FlowLayout) getLayout(); flowLayout.setAlignment(FlowLayout.LEFT); flowLayout.setVgap(0); flowLayout.setHgap(0); JLabel textLabel = new JLabel(label); textLabel.setFont(new Font("Tahoma", Font.BOLD, 11)); textLabel.setPreferredSize(new Dimension(70, 14)); add(textLabel); m_valueLabel = new JLabel(""); m_valueLabel.setPreferredSize(new Dimension(80, 14)); add(m_valueLabel); }
/** Creates the ui. */ private void createUI() { scaleGroupPanel = new JPanel(); FlowLayout flowLayout = (FlowLayout) scaleGroupPanel.getLayout(); flowLayout.setVgap(0); flowLayout.setHgap(0); scaleGroupPanel.setBorder( BorderFactory.createTitledBorder( Localisation.getString(ScaleTool.class, "ScaleTool.scale"))); scaleButton = new ToolButton( Localisation.getString(ScaleTool.class, "ScaleTool.scale"), "tool/scaletool.png"); scaleGroupPanel.add(scaleButton); scaleButton.setEnabled(false); scaleButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { ScaleToolPanel scalePanel = new ScaleToolPanel(application); scalePanel.populate(sldDataList); scalePanel.setVisible(true); } }); scaleGroupPanel.setPreferredSize(new Dimension(PANEL_WIDTH, ToolPanel.TOOL_PANEL_HEIGHT)); }
/** Creates the ui. */ private void createUI() { groupPanel = new JPanel(); FlowLayout flowLayout = (FlowLayout) groupPanel.getLayout(); flowLayout.setVgap(0); flowLayout.setHgap(0); TitledBorder titledBorder = BorderFactory.createTitledBorder( Localisation.getString(MapBoxTool.class, "MapBoxTool.groupTitle")); groupPanel.setBorder(titledBorder); // Export to SLD exportToSLDButton = new ToolButton( Localisation.getString(MapBoxTool.class, "MapBoxTool.exportToSLD"), "tool/exporttosld.png"); exportToSLDButton.setEnabled(false); exportToSLDButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { exportToSLD(); } }); groupPanel.setPreferredSize(new Dimension(PANEL_WIDTH, ToolPanel.TOOL_PANEL_HEIGHT)); groupPanel.add(exportToSLDButton); }
/** * Return the ButtonPanelFlowLayout property value. * @return java.awt.FlowLayout */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private java.awt.FlowLayout getButtonPanelFlowLayout() { java.awt.FlowLayout ivjButtonPanelFlowLayout = null; try { /* Create part */ ivjButtonPanelFlowLayout = new java.awt.FlowLayout(); ivjButtonPanelFlowLayout.setAlignment(java.awt.FlowLayout.LEFT); ivjButtonPanelFlowLayout.setVgap(5); ivjButtonPanelFlowLayout.setHgap(10); } catch (java.lang.Throwable ivjExc) { handleException(ivjExc); }; return ivjButtonPanelFlowLayout; } /**
private void init() { setLayout(new BorderLayout(0, 0)); JPanel panel = new JPanel(); panel.setBorder(new TitledBorder(null, getTitle(), TitledBorder.LEADING, TitledBorder.TOP, null, null)); add(panel, BorderLayout.CENTER); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); for (Measurement m : ImageStatistics.ALL_MEASUREMENTS) { JCheckBox box = new JCheckBox(m.getName(), m.getGraphicLabel()); panel.add(box); map.put(box, m); box.addActionListener(e -> { Object source = e.getSource(); if (source instanceof JCheckBox) { Measurement measure = map.get(e.getSource()); if (measure != null) { measure.setGraphicLabel(((JCheckBox) source).isSelected()); } } }); } JPanel panel2 = new JPanel(); FlowLayout flowLayout1 = (FlowLayout) panel2.getLayout(); flowLayout1.setHgap(10); flowLayout1.setAlignment(FlowLayout.RIGHT); flowLayout1.setVgap(7); add(panel2, BorderLayout.SOUTH); JButton btnNewButton = new JButton(Messages.getString("restore.values")); //$NON-NLS-1$ panel2.add(btnNewButton); btnNewButton.addActionListener(e -> resetoDefaultValues()); }
/** Creates the UI. */ private void createUI() { groupPanel = new JPanel(); FlowLayout flowLayout = (FlowLayout) groupPanel.getLayout(); flowLayout.setVgap(0); flowLayout.setHgap(0); groupPanel.setBorder( BorderFactory.createTitledBorder( Localisation.getString( StickyDataSourceTool.class, "StickyDataSourceTool.groupTitle"))); // Export to YSLD stickyButton = new ToggleToolButton( Localisation.getString( StickyDataSourceTool.class, "StickyDataSourceTool.dataSource"), "tool/stickydatasource.png"); stickyButton.setEnabled(true); final StickyDataSourceTool callingObj = this; stickyButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { SLDEditorFile.getInstance() .setStickyDataSource(callingObj, stickyButton.isSelected()); } }); groupPanel.add(stickyButton); groupPanel.setPreferredSize(new Dimension(PANEL_WIDTH, ToolPanel.TOOL_PANEL_HEIGHT)); }
public LocationButtonsPanel(JTextField textFieldX, JTextField textFieldY, JTextField textFieldZ, JTextField textFieldC) { FlowLayout flowLayout = (FlowLayout) getLayout(); flowLayout.setVgap(0); flowLayout.setHgap(2); this.textFieldX = textFieldX; this.textFieldY = textFieldY; this.textFieldZ = textFieldZ; this.textFieldC = textFieldC; buttonCaptureCamera = new JButton(captureCameraCoordinatesAction); buttonCaptureCamera.setHideActionText(true); add(buttonCaptureCamera); buttonCaptureTool = new JButton(captureToolCoordinatesAction); buttonCaptureTool.setHideActionText(true); add(buttonCaptureTool); JButton buttonCenterCamera = new JButton(positionCameraAction); buttonCenterCamera.setHideActionText(true); add(buttonCenterCamera); buttonCenterTool = new JButton(positionToolAction); buttonCenterTool.setHideActionText(true); add(buttonCenterTool); buttonCenterToolNoSafeZ = new JButton(positionToolNoSafeZAction); buttonCenterToolNoSafeZ.setHideActionText(true); setActuatorName(null); }
@Override protected List<Entry<String, JComponent>> getFormElements() { final List<Entry<String, JComponent>> result = super.getFormElements(); result.add(new ImmutableEntry<>("Salesforce username", _usernameTextField)); result.add(new ImmutableEntry<>("Salesforce password", _passwordTextField)); final DCPanel securityTokenPanel = new DCPanel(Color.WHITE); final FlowLayout layout = (FlowLayout) securityTokenPanel.getLayout(); layout.setVgap(0); layout.setHgap(0); final HelpIcon securityTokenHelpIcon = new HelpIcon("Your security token is set on Salesforce.com by going " + "to: <b><i>Your Name</i> | Setup | My Personal Information | Reset Security Token</b>.<br/>This " + "security token is needed in order to use the Salesforce.com web services."); securityTokenHelpIcon.setBorder(WidgetUtils.BORDER_EMPTY); _securityTokenTextField.setBorder(WidgetUtils.BORDER_EMPTY); securityTokenPanel.add(_securityTokenTextField); securityTokenPanel.add(securityTokenHelpIcon); result.add(new ImmutableEntry<>("Salesforce security token", securityTokenPanel)); result.add(new ImmutableEntry<>("Endpoint", _endpointUrlComboBox)); return result; }
@Override protected List<Entry<String, JComponent>> getFormElements() { final List<Entry<String, JComponent>> result = super.getFormElements(); final DCPanel baseUrlPanel = new DCPanel(Color.WHITE); final FlowLayout layout = (FlowLayout) baseUrlPanel.getLayout(); layout.setVgap(0); layout.setHgap(0); final HelpIcon baseUrlHelpIcon = new HelpIcon( "The base URL is the first part of any URL that you use when you access the SugarCRM system."); baseUrlHelpIcon.setBorder(WidgetUtils.BORDER_EMPTY); _baseUrlTextField.setBorder(WidgetUtils.BORDER_EMPTY); baseUrlPanel.add(_baseUrlTextField); baseUrlPanel.add(baseUrlHelpIcon); result.add(new ImmutableEntry<>("Salesforce security token", baseUrlPanel)); result.add(new ImmutableEntry<>("Salesforce username", _usernameTextField)); result.add(new ImmutableEntry<>("Salesforce password", _passwordTextField)); return result; }
public WtoolBar(String barName, int position) { FlowLayout flowLayout = (FlowLayout) getLayout(); flowLayout.setVgap(0); flowLayout.setHgap(0); flowLayout.setAlignment(FlowLayout.LEADING); this.barName = barName; this.barPosition = position; this.setAlignmentX(LEFT_ALIGNMENT); this.setAlignmentY(TOP_ALIGNMENT); setOpaque(false); addSeparator(SEPARATOR_2x24); }