public static JPanel createSeparator(String message) { JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.WEST; c.insets = new Insets(LARGE_SIZE, 0, LARGE_SIZE, 0); panel.add(createLabel(message), c); c.weightx = 1.0; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(LARGE_SIZE, LARGE_SIZE, LARGE_SIZE, 0); panel.add(new JSeparator(), c); return panel; }
/** * Creates a preview panel for the specified {@link PrintableComponent}. * * @param comp * the {@link PrintableComponent} the preview panel should be created for. */ public PrintPreviewPanel(PrintableComponent comp, PageFormat pageFormat) { this.printer = new ComponentPrinter(comp); this.cardLayout = new CardLayout(); this.pageFormat = pageFormat; setLayout(cardLayout); GridBagConstraints gbc = new GridBagConstraints(); gbc.weightx = 1; gbc.weighty = 1; gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.CENTER; landscapePanel = new JPanel(new GridBagLayout()); landscapePreview = new ComponentPreviewPanel(Orientation.LANDSCAPE); landscapePanel.add(landscapePreview, gbc); add(landscapePanel, Orientation.LANDSCAPE.toString()); portraitPanel = new JPanel(new GridBagLayout()); portraitPreview = new ComponentPreviewPanel(Orientation.PORTRAIT); portraitPanel.add(portraitPreview, gbc); add(portraitPanel, Orientation.PORTRAIT.toString()); // set page format setPageFormat(pageFormat); }
/** * This method initializes this */ private void initialize() { GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.fill = GridBagConstraints.VERTICAL; gridBagConstraints1.gridy = 1; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.insets = new Insets(2, 2, 2, 2); gridBagConstraints1.gridx = 0; GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.insets = new Insets(2, 2, 2, 2); gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints.gridy = 2; GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridx = 0; gridBagConstraints2.insets = new Insets(2, 2, 2, 2); gridBagConstraints2.fill = GridBagConstraints.VERTICAL; gridBagConstraints2.gridy = 3; this.setLayout(new GridBagLayout()); this.add(getExecuteButton(), gridBagConstraints1); this.add(new JLabel("Node query:"), gridBagConstraints); this.add(getQueryField(), gridBagConstraints2); }
private void addLeftRightComponents(JComponent[] ComponentLeft, JComponent[] ComponentRight, GridBagLayout gridbag, Container container) { GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.NORTHEAST; int numLabels = ComponentLeft.length; for (int i = 0; i < numLabels; i++) { c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE; //reset to default c.weightx = 0.0; c.insets = new Insets(0,10,0,0);//reset to default container.add(ComponentLeft[i], c); c.gridwidth = GridBagConstraints.REMAINDER; //end row c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 0.0; c.insets = new Insets(0,10,3,0); container.add(ComponentRight[i], c); } }
private JComponent buildContentLoadingLabel() { JLabel label = new JLabel( BundleSupport.getLabel( "ContentLoading" ) ); // NOI18N label.setHorizontalAlignment( JLabel.CENTER ); label.setVerticalAlignment( JLabel.CENTER ); label.setOpaque( false ); Component header = getContentHeader(); if( null != header ) { JPanel panel = new JPanel( new GridBagLayout() ); panel.setOpaque( false ); panel.add( header, new GridBagConstraints(0,0,1,1,1.0,1.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) ); panel.add( label, new GridBagConstraints(0,1,1,1,1.0,1.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) ); panel.setBorder( BorderFactory.createEmptyBorder(40, 0, 40, 0)); return panel; } label.setBorder( BorderFactory.createEmptyBorder(40, 0, 40, 0)); return label; }
/** Start a menu that allows the user to launch a number of demos for the * JSpikeStack package. To add a new demo to the menu: * 1) Add the appropriate element to the "Demos" enumerator (above); * 2) Add the button in demoMenu() * 3) Connect the enumerator element to the appropriate function in DemoLauncher through the switch statement. */ public static void demoMenu() { JFrame frm=new JFrame(); frm.setTitle("JSpikeStack demos"); Container pane=frm.getContentPane(); JButton button; pane.setLayout(new GridBagLayout()); addDemoButton("Network Generation Demo","Read a network From XML and let it generate",Demos.GENERATE,pane); addDemoButton("Learning Demo","Read an AER file, initialize a random net, and run STDP learning",Demos.LEARN,pane); addDemoButton("Convolution Demo", "Here we read data from the Silicon retina. Two output layers respond to vertically and horizontally oriented features.",Demos.CONV,pane); addDemoButton("RC Network", "Takes retina inputs and fires them to a smoothing network.",Demos.RCNET,pane); addDemoButton("Retina", "In this demo we mimic the behaviour of a variety of types of retinal ganglion cell.",Demos.RETINA,pane); frm.setPreferredSize(new Dimension(500,500)); frm.pack(); frm.setVisible(true); frm.toFront(); frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
public DetectorPanel(){ setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); setPreferredSize(new Dimension(250,130)); setBackground(Color.WHITE); this.detectorLabel= new JLabel("OBRAZ DETEKTORA"); c.gridx = 0; c.gridy = 0; c.anchor=GridBagConstraints.PAGE_START; this.detectorLabel.setFont(this.header); this.add(this.detectorLabel,c); this.detectorImage = new DetectorImage(); c.gridy = 1; c.insets = new Insets(5,0,5,0); this.add(this.detectorImage,c); }
private int addLink( int row, DataObject dob ) { Action action = extractAction( dob ); if( null != action ) { JPanel panel = new JPanel( new GridBagLayout() ); panel.setOpaque(false); ActionButton lb = new ActionButton( action, Utils.getUrlString( dob ), Utils.getColor( COLOR_BIG_BUTTON ), true, dob.getPrimaryFile().getPath() ); panel.add( lb, new GridBagConstraints(1,0,1,3,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(0,0,0,0),0,0) ); lb.setFont( GET_STARTED_FONT ); lb.getAccessibleContext().setAccessibleName( lb.getText() ); lb.getAccessibleContext().setAccessibleDescription( BundleSupport.getAccessibilityDescription( "GettingStarted", lb.getText() ) ); //NOI18N add( panel, new GridBagConstraints( 0,row++,1,1,1.0,0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,3,0), 0, 0 ) ); } return row; }
public GridBagInfoProvider(Container container, LayoutSupportManager layoutManager) { this.container = container; this.layoutManager = layoutManager; LayoutManager containerLayout = container.getLayout(); if (!(containerLayout instanceof GridBagLayout)) { throw new IllegalArgumentException(); } try { tempXField = GridBagConstraints.class.getDeclaredField("tempX"); // NOI18N tempXField.setAccessible(true); tempYField = GridBagConstraints.class.getDeclaredField("tempY"); // NOI18N tempYField.setAccessible(true); tempHeightField = GridBagConstraints.class.getDeclaredField("tempHeight"); // NOI18N tempHeightField.setAccessible(true); tempWidthField = GridBagConstraints.class.getDeclaredField("tempWidth"); // NOI18N tempWidthField.setAccessible(true); } catch (NoSuchFieldException nsfex) { FormUtils.LOGGER.log(Level.INFO, nsfex.getMessage(), nsfex); } containerEmphColor = deriveEmphColor(container); }
public QualityPanel() { super(); GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); setLayout(gridbag); setBorder(BorderFactory.createTitledBorder(strTitle)); c.fill = GridBagConstraints.BOTH; c.gridwidth = GridBagConstraints.REMAINDER; c.weighty = 1.0; ButtonGroup bg = new ButtonGroup(); rbDraft = createRadioButton("radiobutton.draftq", this); bg.add(rbDraft); addToGB(rbDraft, this, gridbag, c); rbNormal = createRadioButton("radiobutton.normalq", this); rbNormal.setSelected(true); bg.add(rbNormal); addToGB(rbNormal, this, gridbag, c); rbHigh = createRadioButton("radiobutton.highq", this); bg.add(rbHigh); addToGB(rbHigh, this, gridbag, c); }
/** * Creates either a {@link LinkLocalButton} or a {@link LinkRemoteButton} that executes the * action stored in type. * * @param type * the type */ public LinkButtonValueCellEditor(final ParameterTypeLinkButton type) { super(new JTextField()); this.container = new JPanel(new GridBagLayout()); this.container.setToolTipText(type.getDescription()); GridBagConstraints gbc = new GridBagConstraints(); JComponent linkButton; if (type.isLocalAction()) { linkButton = new LinkLocalButton(type.getAction()); } else { linkButton = new LinkRemoteButton(type.getAction()); } gbc.gridx += 1; gbc.weightx = 1; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(linkButton, gbc); }
private void initComponents(String text, Font font) { setBorder(BorderFactory.createEmptyBorder()); setLayout(new GridBagLayout()); setOpaque(false); label = new JLabel(text); label.setForeground(getForeground()); if (font != null) label.setFont(font); else label.setFont(label.getFont().deriveFont(Font.BOLD)); GridBagConstraints c1 = new GridBagConstraints(); c1.weighty = 1d; add(label, c1); GridBagConstraints c2 = new GridBagConstraints(); c2.weightx = 1d; c2.fill = GridBagConstraints.HORIZONTAL; c2.insets = new Insets(0, 4, 0, 0); add(new Separator(), c2); }
public DrivestrengthMainWindow() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } setLayout(new GridBagLayout()); setTitle("ASGDrivestrength"); setSize(500, 300); JSlider percentageEnergySlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 0); JButton runButton = new JButton("Run"); add(percentageEnergySlider); add(runButton); setVisible(true); }
ViewModelListener( String viewType, JComponent view, JComponent buttonsPane, String propertiesHelpID, Image viewIcon ) { this.viewType = viewType; this.view = view; this.buttonsPane = buttonsPane; buttonsPane.setLayout(new GridBagLayout()); this.propertiesHelpID = propertiesHelpID; this.viewIcon = viewIcon; initView(); setUp(); }
public ChromaticityPanel() { super(); GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); setLayout(gridbag); setBorder(BorderFactory.createTitledBorder(strTitle)); c.fill = GridBagConstraints.BOTH; c.gridwidth = GridBagConstraints.REMAINDER; c.weighty = 1.0; ButtonGroup bg = new ButtonGroup(); rbMonochrome = createRadioButton("radiobutton.monochrome", this); rbMonochrome.setSelected(true); bg.add(rbMonochrome); addToGB(rbMonochrome, this, gridbag, c); rbColor = createRadioButton("radiobutton.color", this); bg.add(rbColor); addToGB(rbColor, this, gridbag, c); }
/** Creates new form ProgressPanel */ public ProgressPanel() { initComponents(); handle = ProgressHandleFactory.createHandle( NbBundle.getMessage(ImportProjectAction.class, "CTL_ProgressDialogTitle")); // NOI18N progress = ProgressHandleFactory.createProgressComponent(handle); setLayout(new GridBagLayout()); setPreferredSize(new Dimension(450, 80)); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new Insets(0, 5, 0, 5); add(progress, gridBagConstraints); }
/** * This method initializes this * @return void */ private void initialize() { GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.rowWeights = new double[]{0.0}; gridBagLayout.columnWeights = new double[]{1.0}; this.setLayout(gridBagLayout); this.setSize(950, 500); GridBagConstraints gbc_ServiceLists = new GridBagConstraints(); gbc_ServiceLists.gridx = 0; gbc_ServiceLists.fill = GridBagConstraints.BOTH; gbc_ServiceLists.insets = new Insets(10, 10, 5, 10); gbc_ServiceLists.weightx = 1.0; gbc_ServiceLists.weighty = 1.0; gbc_ServiceLists.ipadx = 0; gbc_ServiceLists.gridy = 0; this.add(this.getJPanelServiceLists(), gbc_ServiceLists); }
/** * Initialize. */ private void initialize() { GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[] { 0, 0 }; gridBagLayout.rowHeights = new int[] { 0, 0, 0 }; gridBagLayout.columnWeights = new double[] { 1.0, Double.MIN_VALUE }; gridBagLayout.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE }; setLayout(gridBagLayout); GridBagConstraints gbc_jPanelSimulationEnvironment = new GridBagConstraints(); gbc_jPanelSimulationEnvironment.insets = new Insets(10, 10, 0, 0); gbc_jPanelSimulationEnvironment.anchor = GridBagConstraints.NORTH; gbc_jPanelSimulationEnvironment.fill = GridBagConstraints.HORIZONTAL; gbc_jPanelSimulationEnvironment.gridx = 0; gbc_jPanelSimulationEnvironment.gridy = 0; add(getJPanelSimulationEnvironment(), gbc_jPanelSimulationEnvironment); GridBagConstraints gbc_jPanelTimeModelSelection = new GridBagConstraints(); gbc_jPanelTimeModelSelection.anchor = GridBagConstraints.WEST; gbc_jPanelTimeModelSelection.insets = new Insets(10, 10, 0, 0); gbc_jPanelTimeModelSelection.fill = GridBagConstraints.VERTICAL; gbc_jPanelTimeModelSelection.gridx = 0; gbc_jPanelTimeModelSelection.gridy = 1; add(getJPanelTimeModelSelection(), gbc_jPanelTimeModelSelection); }
/** * This method initializes this * @return void */ private void initialize() { GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridx = 0; gridBagConstraints11.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints11.weightx = 1.0; gridBagConstraints11.gridy = 1; GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.gridwidth = 1; this.setSize(300, 200); this.setLayout(new GridBagLayout()); this.add(getJScrollPaneTextVersion(), gridBagConstraints); this.add(getJPanelBottom(), gridBagConstraints11); }
protected void addSeperatorToPanel(JPanel addTarget) { if (!(addTarget.getLayout() instanceof GridBagLayout)) { throw new RuntimeException("JPanel with GridBagLayout is mandatory!"); } JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL); GridBagConstraints itemConstraint = new GridBagConstraints(); itemConstraint.gridx = GridBagConstraints.RELATIVE; itemConstraint.weightx = 1.0; itemConstraint.gridwidth = GridBagConstraints.REMAINDER; // end row itemConstraint.fill = GridBagConstraints.HORIZONTAL; itemConstraint.insets = new Insets(0, 5, 5, 5); addTarget.add(separator, itemConstraint); }
/** * Initialise. */ private void initialize() { GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[]{0, 0}; gridBagLayout.rowHeights = new int[]{0, 0, 0}; gridBagLayout.columnWeights = new double[]{0.0, Double.MIN_VALUE}; gridBagLayout.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE}; setLayout(gridBagLayout); jLabelServerHeader = new JLabel(); jLabelServerHeader.setText("Agent.GUI Hintergrundsystem - Konfiguration"); jLabelServerHeader.setFont(new Font("Dialog", Font.BOLD, 12)); GridBagConstraints gbc_jLabelServerHeader = new GridBagConstraints(); gbc_jLabelServerHeader.anchor = GridBagConstraints.WEST; gbc_jLabelServerHeader.insets = new Insets(0, 0, 5, 0); gbc_jLabelServerHeader.gridx = 0; gbc_jLabelServerHeader.gridy = 0; this.add(jLabelServerHeader, gbc_jLabelServerHeader); GridBagConstraints gbc_jCheckBoxAutoStart = new GridBagConstraints(); gbc_jCheckBoxAutoStart.anchor = GridBagConstraints.WEST; gbc_jCheckBoxAutoStart.gridx = 0; gbc_jCheckBoxAutoStart.gridy = 1; this.add(getJCheckBoxAutoStart(), gbc_jCheckBoxAutoStart); }
private JComponent createContent(JComponent titleComp, JComponent detailsComp, JComponent priorityComp, JComponent categoryComp, JComponent dateComp) { //TODO bold field, add label to timestamp - Created: JPanel panel = new JPanel(new GridBagLayout()); panel.setOpaque(false); panel.add(titleComp, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 3, 3), 0, 0)); if (priorityComp != null) { panel.add(priorityComp, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 10, 3, 3), 0, 0)); } if (categoryComp != null) { panel.add(categoryComp, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 10, 3, 3), 0, 0)); } panel.add(detailsComp, new GridBagConstraints(0, 2, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(10, 10, 3, 3), 0, 0)); panel.add(new JLabel(), new GridBagConstraints(2, 3, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); if (dateComp != null) { panel.add(dateComp, new GridBagConstraints(2, 4, 3, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(3, 3, 3, 3), 0, 0)); } ActionListener actionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { markAsRead(true); } }; addActionListener(detailsComp, actionListener); return panel; }
private JComponent createPriority(Priority p) { JPanel panel = new JPanel(new GridBagLayout()); panel.setOpaque(false); panel.add(new JLabel(NbBundle.getMessage(NotificationImpl.class, "LBL_Priority")), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0)); panel.add(new JLabel(p.getIcon()), new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); panel.add(new JLabel(p.name()), new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 3, 0, 0), 0, 0)); panel.add(new JLabel(), new GridBagConstraints(3, 0, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); return panel; }
private JComponent createCategory(Category c) { JPanel panel = new JPanel(new GridBagLayout()); panel.setOpaque(false); panel.add(new JLabel(NbBundle.getMessage(NotificationImpl.class, "LBL_Category")), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0)); panel.add(new JLabel(c.getDisplayName()), new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); panel.add(new JLabel(), new GridBagConstraints(2, 0, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); return panel; }
public AverageVectorViewer(AverageVector vector, IOContainer container) { setLayout(new GridLayout(1, 1)); this.vector = vector; JPanel mainPanel = new JPanel(); GridBagLayout layout = new GridBagLayout(); mainPanel.setLayout(layout); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.insets = new Insets(11, 11, 11, 11); c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1.0d; c.weighty = 0.0d; JLabel mainLabel = new JLabel("<html><h2>" + getName() + " (" + vector.size() + ")</h2></html>"); layout.setConstraints(mainLabel, c); mainPanel.add(mainLabel); for (int i = 0; i < vector.size(); i++) { Averagable avg = vector.getAveragable(i); Component visualizationComponent = ResultDisplayTools.createVisualizationComponent(avg, container, "Averagable"); layout.setConstraints(visualizationComponent, c); mainPanel.add(visualizationComponent); } ExtendedJScrollPane scrollPane = new ExtendedJScrollPane(mainPanel); scrollPane.setBorder(null); add(scrollPane); }
private ContentSection( JComponent content, boolean maxSize, int leftInsets ) { super( new GridBagLayout() ); setOpaque(false); this.maxSize = maxSize; add( content, new GridBagConstraints(0,1,2,1,1.0,1.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,leftInsets,0,0),0,0) ); setBorder( BorderFactory.createEmptyBorder(22,35,15,35) ); }
private JComponent buildProxyPanel() { Component header = getContentHeader(); JPanel panel = new JPanel(new GridBagLayout()); panel.setOpaque( false ); int row = 0; if( null != header ) { panel.add( header, new GridBagConstraints(0,row++,1,1,1.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) ); } panel.add( new JLabel(BundleSupport.getLabel("ErrCannotConnect")), // NOI18N new GridBagConstraints(0,row++,1,1,0.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); if( showProxyButton ) { JButton button = new JButton(); Mnemonics.setLocalizedText( button, BundleSupport.getLabel( "ProxyConfig" ) ); // NOI18N button.setOpaque( false ); button.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { HttpProxySettings.getDefault().showConfigurationDialog(); } }); panel.add( button, new GridBagConstraints(0,row++,1,1,0.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); } return panel; }
private JComponent buildErrorLabel() { Component header = getContentHeader(); JPanel panel = new JPanel(new GridBagLayout()); panel.setOpaque( false ); int row = 0; if( null != header ) { panel.add( header, new GridBagConstraints(0,row++,1,1,1.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) ); } panel.add( new JLabel(BundleSupport.getLabel("ErrLoadingFeed")), // NOI18N new GridBagConstraints(0,row++,1,1,0.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); JButton button = new JButton(); Mnemonics.setLocalizedText( button, BundleSupport.getLabel( "Reload" ) ); // NOI18N button.setOpaque( false ); button.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { lastReload = 0; reload(); } }); panel.add( button, new GridBagConstraints(0,row++,1,1,0.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); return panel; }
public MediaPanel() { super(); GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); setLayout(gridbag); setBorder(BorderFactory.createTitledBorder(strTitle)); cbSize = new JComboBox<>(); cbSource = new JComboBox<>(); c.fill = GridBagConstraints.BOTH; c.insets = compInsets; c.weighty = 1.0; c.weightx = 0.0; lblSize = new JLabel(getMsg("label.size"), JLabel.TRAILING); lblSize.setDisplayedMnemonic(getMnemonic("label.size")); lblSize.setLabelFor(cbSize); addToGB(lblSize, this, gridbag, c); c.weightx = 1.0; c.gridwidth = GridBagConstraints.REMAINDER; addToGB(cbSize, this, gridbag, c); c.weightx = 0.0; c.gridwidth = 1; lblSource = new JLabel(getMsg("label.source"), JLabel.TRAILING); lblSource.setDisplayedMnemonic(getMnemonic("label.source")); lblSource.setLabelFor(cbSource); addToGB(lblSource, this, gridbag, c); c.gridwidth = GridBagConstraints.REMAINDER; addToGB(cbSource, this, gridbag, c); }
private JPanel createTabulaPanel() { JPanel tabulaPanel = new JPanel(); tabulaModelBox = new JComboBox<ComboBoxFileItem>(getComboBoxFileItems()); tabulaModelBox.setPrototypeDisplayValue(new ComboBoxFileItem(new File("ModelSomethingOrOther.obm"))); tabulaModelBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { modelFile = ((ComboBoxFileItem) tabulaModelBox.getSelectedItem()).file; refresh(); } }); JLabel label = new JLabel("Tabula Model:"); label.setPreferredSize(new Dimension(150, 25)); tabulaPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.weightx = 1; c.insets = new Insets(5, 5, 5, 5); tabulaPanel.add(label, c); c.gridx = 1; tabulaPanel.add(tabulaModelBox, c); return tabulaPanel; }
public BottomBar() { super( new GridBagLayout() ); setOpaque(true); setBackground( Utils.getBottomBarColor() ); add( Logo.createOracleLogo(), new GridBagConstraints(0,0,1,1,0.0,0.0, GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(0,12,0,5),0,0 ) ); add( new JLabel(), new GridBagConstraints(1,0,1,1,1.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0 ) ); add( Logo.createJavaLogo(), new GridBagConstraints(4,0,1,1,0.0,0.0, GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(5,5,5,12),0,0 ) ); }
private void initializeLayout() { GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[] { 0, 0, 70, 130, 0, 0, 0 }; gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; gridBagLayout.columnWeights = new double[] { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, Double.MIN_VALUE }; gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; this.panel.setLayout(gridBagLayout); }
public TestDialog() { JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); for (int i=0; i < Xs.length; i++) { gbc.gridx = Xs[i]; gbc.gridy = 100 - gbc.gridx; panel.add(new MyComponent(), gbc); } getRootPane().getContentPane().add(panel); pack(); }
private static void addComponent (Container container, Component component) { GridBagConstraints c = new GridBagConstraints(); c.gridx = c.gridy = GridBagConstraints.RELATIVE; c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.NORTHWEST; c.weightx = c.weighty = 1.0; ((GridBagLayout)container.getLayout()).setConstraints (component,c); container.add (component); }
public TestingTab(CAEAgent agent, PlayerPanel view) { super(new GridBagLayout()); this.cmdsHistory = PlayHook.voiceControl.getCommandsHistory(); this.cmdsHistoryTable = new JTable(cmdsHistory); this.cmdsHistoryTable.getTableHeader().setVisible(true); this.cmdsHistoryTable.getTableHeader().setReorderingAllowed(false); this.cmdsHistoryTable.getModel().addTableModelListener(view); }
private void initComponents() { setLayout(new GridBagLayout()); textPane = new NbiTextPane(); textPanel = new NbiPanel(); textPanel.setLayout(new BorderLayout()); textPanel.add(textPane, BorderLayout.CENTER); textScrollPane = new NbiScrollPane(textPanel); textScrollPane.setViewportBorder(new EmptyBorder(new Insets(5, 5, 5, 5))); textScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); add(textScrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(11, 11, 11, 11), 0, 0)); }
private JPanel getTitleSection() { JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); setLabelPanel(panel, c); setHeaderPanel(panel, c); setFooterPanel(panel, c); setMacroPanel(panel, c); // panel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.red)); return panel; }
private JPanel getTextSection() { JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.WEST; createTopTextPanel(panel, c); createBottomTextPanel(panel, c); return panel; }
public PrintAppearanceJPanel(PrintJDialog objPprintJDialog, ControlJFrame objPcontrolJFrame) { this.objGprintChromaticitySubJPanel = new PrintChromaticitySubJPanel(objPprintJDialog, objPcontrolJFrame); this.objGprintQualitySubJPanel = new PrintQualitySubJPanel(objPprintJDialog); this.objGprintSidesSubJPanel = new PrintSidesSubJPanel(objPprintJDialog, objPcontrolJFrame); this.objGprintJobAttributesSubJPanel = new PrintJobAttributesSubJPanel(objPprintJDialog); this.setOpaque(true); this.setLayout(new GridBagLayout()); final ExtendedGridBagConstraints objLextendedGridBagConstraints = new ExtendedGridBagConstraints( GridBagConstraints.RELATIVE, 0, 1, 1, GridBagConstraints.CENTER, 6, 6, 6, 6, GridBagConstraints.BOTH, 1.0F, 1.0F); this.add(this.objGprintChromaticitySubJPanel, objLextendedGridBagConstraints); this.add(this.objGprintQualitySubJPanel, objLextendedGridBagConstraints); objLextendedGridBagConstraints.setGridLocation(GridBagConstraints.RELATIVE, 1); this.add(this.objGprintSidesSubJPanel, objLextendedGridBagConstraints); this.add(this.objGprintJobAttributesSubJPanel, objLextendedGridBagConstraints); }