Java Code Examples for java.awt.GridBagConstraints#clone()
The following examples show how to use
java.awt.GridBagConstraints#clone() .
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: Font2DTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 2
Source File: Font2DTest.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 3
Source File: Font2DTest.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 4
Source File: Font2DTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 5
Source File: Font2DTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 6
Source File: Font2DTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 7
Source File: Font2DTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 8
Source File: Font2DTest.java From hottub with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 9
Source File: Font2DTest.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 10
Source File: Font2DTest.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 11
Source File: Font2DTest.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 12
Source File: Font2DTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 13
Source File: Font2DTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
private void addLabeledComponentToGBL( String name, JComponent c, GridBagLayout gbl, GridBagConstraints gbc, Container target ) { LabelV2 l = new LabelV2( name ); GridBagConstraints gbcLabel = (GridBagConstraints) gbc.clone(); gbcLabel.insets = new Insets( 2, 2, 2, 0 ); gbcLabel.gridwidth = 1; gbcLabel.weightx = 0; if ( c == null ) c = new JLabel( "" ); gbl.setConstraints( l, gbcLabel ); target.add( l ); gbl.setConstraints( c, gbc ); target.add( c ); }
Example 14
Source File: FormView.java From arcusplatform with Apache License 2.0 | 5 votes |
private void init() { labelConstraints = new GridBagConstraints(); labelConstraints.gridx = 0; labelConstraints.gridy = 0; labelConstraints.weightx = 0.0; labelConstraints.weighty = 0.0; labelConstraints.fill = GridBagConstraints.NONE; labelConstraints.anchor = GridBagConstraints.EAST; fieldConstraints = new GridBagConstraints(); fieldConstraints.gridx = 1; fieldConstraints.gridy = 0; fieldConstraints.weightx = 1.0; fieldConstraints.weighty = 0.0; fieldConstraints.fill = GridBagConstraints.HORIZONTAL; wideLabelConstraints = new GridBagConstraints(); wideLabelConstraints.gridx = 0; wideLabelConstraints.gridy = 0; wideLabelConstraints.gridwidth = 2; wideLabelConstraints.weightx = 1.0; wideLabelConstraints.weighty = 0.0; wideLabelConstraints.fill = GridBagConstraints.HORIZONTAL; wideFieldConstraints = new GridBagConstraints(); wideFieldConstraints.gridx = 0; wideFieldConstraints.gridy = 0; wideFieldConstraints.gridwidth = 2; wideFieldConstraints.weightx = 1.0; wideFieldConstraints.weighty = 1.0; wideFieldConstraints.fill = GridBagConstraints.BOTH; componentConstraints = (GridBagConstraints) wideFieldConstraints.clone(); GridBagConstraints buttonConstraints = (GridBagConstraints) wideLabelConstraints.clone(); buttonConstraints.gridy = 1000; panel.add(buttons, buttonConstraints); }
Example 15
Source File: OurUtil.java From org.alloytools.alloy with Apache License 2.0 | 5 votes |
public static JPanel makeGrid(int cols, GridBagConstraints template, Container... containers) { JPanel ans = new JPanel(new GridBagLayout()); int i = -1; for (Container container : containers) { for (Component comp : container.getComponents()) { i++; GridBagConstraints c = (GridBagConstraints) template.clone(); c.gridx = i % cols; c.gridy = i / cols; ans.add(comp, c); } } return ans; }
Example 16
Source File: GridBagHelper.java From thunderstorm with GNU General Public License v3.0 | 4 votes |
public Builder(GridBagConstraints gbc) { this.gbc = (GridBagConstraints) gbc.clone(); }