类java.awt.GridBagConstraints源码实例Demo

下面列出了怎么用java.awt.GridBagConstraints的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: ramus   文件: HTMLEditOptionPanel.java
/**
 * This method initializes this
 *
 * @return void
 */
private void initialize() {
    final GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
    gridBagConstraints3.gridx = 3;
    gridBagConstraints3.gridy = 0;
    final GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
    gridBagConstraints2.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints2.gridy = 0;
    gridBagConstraints2.weightx = 1.0;
    gridBagConstraints2.gridx = 2;
    final GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
    gridBagConstraints1.gridx = 1;
    gridBagConstraints1.gridy = 0;
    final GridBagConstraints gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    jLabel = new JLabel();
    jLabel.setText(GlobalResourcesManager.getString("HTMLEditor.Programm"));
    this.setSize(300, 200);
    setLayout(new GridBagLayout());
    this.add(jLabel, gridBagConstraints);
    this.add(getJPanel(), gridBagConstraints1);
    this.add(getJTextField(), gridBagConstraints2);
    this.add(getJButton(), gridBagConstraints3);
}
 
源代码2 项目: DominionSim   文件: DomBotSelector.java
private JPanel getSelectionPanel() {
    final JPanel thePanel = new JPanel();
    thePanel.setLayout( new GridBagLayout() );
    final GridBagConstraints theCons = DomGui.getGridBagConstraints( 2 );
    JScrollPane theTypePane = new JScrollPane(getBotTypeList(), JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    theTypePane.setBorder(new TitledBorder( "Type" ));
    theCons.weightx = 0.0;
    theCons.weighty = 1.0;
    thePanel.add(theTypePane, theCons);

    theCons.weightx = 1.0;
    theCons.gridx++;
    thePanel.add(getBotPanel(), theCons);

    return thePanel;
}
 
源代码3 项目: javamoney-examples   文件: DataElementPanel.java
private
Panel
createNewPanel(ActionListener listener)
{
  Panel panel = new Panel();
  String key = getCollection().getType().toString().toLowerCase();
  Link link = new Link(getProperty("default") + " " + key, listener, ACTION_ADD);

  // Build link.
  link.setBackground(GUIConstants.COLOR_BACKGROUND_FILL);

  // Build panel.
  panel.setAnchor(GridBagConstraints.NORTHWEST);
  panel.add(link, 0, 0, 1, 1, 100, 100);

  panel.setBackground(GUIConstants.COLOR_BACKGROUND_FILL);
  panel.setBorder(createTitledBorder(""));

  return panel;
}
 
protected GridBagConstraints getObject() {
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 2;
    gbc.gridwidth = 3;
    gbc.gridheight = 4;
    gbc.weightx = 0.1;
    gbc.weighty = 0.2;
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.fill = GridBagConstraints.VERTICAL;
    gbc.insets.top = 1;
    gbc.insets.left = 2;
    gbc.insets.right = 3;
    gbc.insets.bottom = 4;
    gbc.ipadx = -1;
    gbc.ipady = -2;
    return gbc;
}
 
private void anhadeTextAreaParaTextoAnalizado(Container contenedor) {
	areaDeTextoAAnalizar = new JTextArea();
       areaDeTextoAAnalizar.setLineWrap(true);
       areaDeTextoAAnalizar.setWrapStyleWord(true);
       areaDeTextoAAnalizar.setColumns(40);
       areaDeTextoAAnalizar.invalidate();

       JScrollPane scroll = new JScrollPane(areaDeTextoAAnalizar);
       scroll.setBorder(new TitledBorder("Escribe o copia aqu� un texto"));

       GridBagConstraints constraints = new GridBagConstraints();
       constraints.gridx = 0;
       constraints.gridy = 1;
       constraints.gridwidth = 4;
       constraints.gridheight = 1;
       constraints.weightx = 1.0;
       constraints.weighty = 1.0;
       constraints.fill = GridBagConstraints.BOTH;
       contenedor.add(scroll, constraints);
}
 
源代码6 项目: MtgDesktopCompanion   文件: UITools.java
public static GridBagConstraints createGridBagConstraints(Integer anchor,Integer fill,int col,int line)
{
	GridBagConstraints cons = new GridBagConstraints();
	
	if(anchor!=null)
		cons.anchor = anchor;
	
	if(fill!=null)
		cons.fill = fill;
	
	cons.insets = new Insets(0, 0, 5, 5);
	cons.gridx = col;
	cons.gridy = line;
	
	return cons;
}
 
private void addUseCustomQTCheckBox(JPanel panel, int col, int row)
{
	GridBagConstraints c = new GridBagConstraints();
	c.gridx = col;
	c.gridy = row;
	c.insets = new Insets(5, 5, 0, 0);
	c.anchor = GridBagConstraints.WEST;
	c.gridwidth = 2; // Span across two columns
	useCustomQTCheckBox = new JCheckBox(i18n.USE_CUSTOM_QT_LABEL);
	useCustomQTCheckBox.setName("useCustomQTCheckBox");

	// i18n[PreferencesPanel.useCustomQTToolTip=Gives enhanced capabilities
	// over the default query tokenizer for handling {0} scripts]
	String USE_CUSTOM_QT_TOOLTIP =
		s_stringMgr.getString("PreferencesPanel.useCustomQTToolTip", _databaseName);

	useCustomQTCheckBox.setToolTipText(USE_CUSTOM_QT_TOOLTIP);
	useCustomQTCheckBox.addActionListener(new UseQTHandler());
	panel.add(useCustomQTCheckBox, c);
}
 
private
Panel
createFilterPanel()
{
  Panel panel = new Panel();

  // Build panel.
  panel.setFill(GridBagConstraints.BOTH);
  panel.add(createChooserPanel(getChoosers()[ACCOUNTS], ACTION_ACCOUNTS), 0, 0, 1, 1, 50, 100);
  panel.addEmptyCellAt(1, 0);
  panel.add(createChooserPanel(getChoosers()[CATEGORIES], ACTION_CATEGORIES), 2, 0, 1, 1, 50, 0);
  panel.addEmptyCellAt(3, 0);
  panel.add(createChooserPanel(getChoosers()[PAYEES], ACTION_PAYEES), 4, 0, 1, 1, 50, 0);

  panel.setInsets(new Insets(10, 10, 10, 10));

  return panel;
}
 
源代码9 项目: collect-earth   文件: PropertiesDialog.java
private JPanel getSqlLitePanel() {
	final JPanel panel = new JPanel(new GridBagLayout());
	final GridBagConstraints constraints = new GridBagConstraints();
	constraints.gridx = 0;
	constraints.gridy = 0;
	constraints.anchor = GridBagConstraints.LINE_START;
	constraints.insets = new Insets(5, 5, 5, 5);
	constraints.weightx = 1.0;
	constraints.fill = GridBagConstraints.HORIZONTAL;

	final Border border = new TitledBorder(new BevelBorder(BevelBorder.RAISED),
			Messages.getString("OptionWizard.30")); //$NON-NLS-1$
	panel.setBorder(border);

	panel.add(propertyToComponent.get(EarthProperty.AUTOMATIC_BACKUP)[0], constraints);
	constraints.gridx++;
	panel.add(getOpenBackupFolderButton());
	return panel;
}
 
public CustomPayloadsOptionsPanel() {
    this.tableModel = new CustomPayloadMultipleOptionsTableModel();
    this.tablePanel = new CustomPayloadsMultipleOptionsTablePanel(tableModel);
    this.setName(OPTIONS_TITLE);
    this.setLayout(new GridBagLayout());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.weightx = 1.0;
    gbc.anchor = GridBagConstraints.LINE_START;
    gbc.fill = GridBagConstraints.BOTH;

    this.add(new JLabel(OPTIONS_TITLE), gbc);
    gbc.weighty = 1.0;
    this.add(tablePanel, gbc);
}
 
源代码11 项目: lucene-solr   文件: DocumentsPanelProvider.java
private JPanel initUpperPanel() {
  JPanel panel = new JPanel(new GridBagLayout());
  panel.setOpaque(false);
  GridBagConstraints c = new GridBagConstraints();

  c.gridx = 0;
  c.gridy = 0;
  c.weightx = 0.5;
  c.anchor = GridBagConstraints.FIRST_LINE_START;
  c.fill = GridBagConstraints.HORIZONTAL;
  panel.add(initBrowseTermsPanel(), c);

  c.gridx = 1;
  c.gridy = 0;
  c.weightx = 0.5;
  c.anchor = GridBagConstraints.FIRST_LINE_START;
  c.fill = GridBagConstraints.HORIZONTAL;
  panel.add(initBrowseDocsByTermPanel(), c);

  return panel;
}
 
源代码12 项目: visualvm   文件: SectionSeparator.java
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);
}
 
源代码13 项目: jdk8u-dev-jdk   文件: Font2DTest.java
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 );
}
 
源代码14 项目: netbeans   文件: DetectPanel.java
@Override
public void readSettings(WizardDescriptor settings) {           
    sources = null;
    sourcesString = null;
    javadoc = null;
    javadocString = null;
    this.wiz = settings;
    this.component.progressPanel.setVisible (true);
    this.component.progressLabel.setVisible (true);
    
    this.progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(DetectPanel.class,"TXT_PlatfromDetectProgress"));
    this.component.progressPanel.removeAll();
    this.component.progressPanel.setLayout (new GridBagLayout ());
    GridBagConstraints c = new GridBagConstraints ();
    c.gridx = c.gridy = GridBagConstraints.RELATIVE;
    c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1.0;
    JComponent pc = ProgressHandleFactory.createProgressComponent(this.progressHandle);
    ((GridBagLayout)this.component.progressPanel.getLayout ()).setConstraints(pc,c);
    this.component.progressPanel.add (pc);
    this.progressHandle.start ();
    task.schedule(0);
}
 
源代码15 项目: javamoney-examples   文件: ViewsPanel.java
/**
 * Constructs a new views panel.
 */
public
ViewsPanel()
{
  setCardPanel(new JPanel(new CardLayout()));
  setView(null);
  setViewChooser(new ViewChooser());

  createViews();

  // Put the views into the cards.
  for(ViewKeys key : ViewKeys.values())
  {
    getCardPanel().add(getView(key), key.toString());
  }

  // Build panel.
  setFill(GridBagConstraints.BOTH);
  add(getViewChooser(), 0, 0, 1, 1, 100, 0);
  add(getCardPanel(), 0, 1, 1, 1, 0, 100);

  setInsets(new Insets(0, 10, 10, 10));
}
 
源代码16 项目: netbeans   文件: XmlOptionPanelManager.java
@Override
protected int initAdditionalSyntaxButton( int gridy, 
        final TargetChooserPanel<FileType> panel,
        final TargetChooserPanelGUI<FileType> uiPanel) 
{
    myXmlSyntaxButton.setMnemonic(NbBundle.getMessage(XmlOptionPanelManager.class, 
            "A11Y_JspXml_mnem").charAt(0));
    getButtonGroup().add(myXmlSyntaxButton);
    myXmlSyntaxButton.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            checkBoxChanged(evt, panel, uiPanel);
        }
    });

    GridBagConstraints gridBagConstraints = new GridBagConstraints();
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = gridy++;
    gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    getOptionPanel().add(myXmlSyntaxButton, gridBagConstraints);
    return gridy;
}
 
源代码17 项目: snap-desktop   文件: NewProductDialog.java
private JPanel createInfoPanel() {
    final JPanel infoPanel = GridBagUtils.createDefaultEmptyBorderPanel();
    infoPanel.setBorder(UIUtils.createGroupBorder("Output Product Information"));
    final GridBagConstraints gbc2 = GridBagUtils.createDefaultConstraints();
    GridBagUtils.addToPanel(infoPanel, new JLabel("Scene Width:"), gbc2);
    GridBagUtils.addToPanel(infoPanel, labelWidthInfo, gbc2);
    GridBagUtils.addToPanel(infoPanel, new JLabel("pixel"), gbc2, "weightx=1");
    GridBagUtils.addToPanel(infoPanel, new JLabel("Scene Height:"), gbc2, "gridy=1, weightx=0");
    GridBagUtils.addToPanel(infoPanel, labelHeightInfo, gbc2);
    GridBagUtils.addToPanel(infoPanel, new JLabel("pixel"), gbc2, "weightx=1");
    GridBagUtils.addToPanel(infoPanel, new JLabel("Center Latitude:"), gbc2, "gridy=2, weightx=0");
    GridBagUtils.addToPanel(infoPanel, labelCenterLatInfo, gbc2, "weightx=1, gridwidth=2");
    GridBagUtils.addToPanel(infoPanel, new JLabel("Center Longitude:"), gbc2, "gridy=3, weightx=0, gridwidth=1");
    GridBagUtils.addToPanel(infoPanel, labelCenterLonInfo, gbc2, "weightx=1, gridwidth=2");
    return infoPanel;
}
 
源代码18 项目: raccoon4   文件: LoginLogic.java
@Override
protected JPanel assemble() {
	progress = new JProgressBar();
	status = new HyperTextPane("                             ")
			.withTransparency().withWidth(400);

	JPanel ret = new JPanel();
	ret.setLayout(new GridBagLayout());
	GridBagConstraints gbc = new GridBagConstraints();
	gbc.anchor = GridBagConstraints.CENTER;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 0;
	gbc.gridy = 0;
	gbc.insets.top = 20;
	ret.add(progress, gbc);
	gbc.weighty = 1;
	gbc.gridy++;
	gbc.fill = GridBagConstraints.BOTH;
	ret.add(status, gbc);
	return ret;
}
 
源代码19 项目: snap-desktop   文件: GridBagUtils.java
/**
 * Adds a component to a panel with a grid bag layout.
 *
 * @param panel the panel to which to add the component
 * @param comp  the component to be added
 * @param gbc   the grid bag constraints to be used, can be <code>null</code> if <code>code</code> is not
 *              <code>null</code>
 */
public static void addToPanel(JPanel panel, Component comp, GridBagConstraints gbc) {
    LayoutManager layoutManager = panel.getLayout();
    if (!(layoutManager instanceof GridBagLayout)) {
        throw new IllegalArgumentException("'panel' does not have a GridBagLayout manager");
    }
    GridBagLayout gbl = (GridBagLayout) layoutManager;
    gbl.setConstraints(comp, gbc);
    panel.add(comp);
}
 
源代码20 项目: hottub   文件: ServiceDialog.java
public OrientationPanel() {
    super();

    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();

    setLayout(gridbag);
    setBorder(BorderFactory.createTitledBorder(strTitle));

    c.fill = GridBagConstraints.BOTH;
    c.insets = compInsets;
    c.weighty = 1.0;
    c.gridwidth = GridBagConstraints.REMAINDER;

    ButtonGroup bg = new ButtonGroup();
    rbPortrait = new IconRadioButton("radiobutton.portrait",
                                     "orientPortrait.png", true,
                                     bg, this);
    rbPortrait.addActionListener(this);
    addToGB(rbPortrait, this, gridbag, c);
    rbLandscape = new IconRadioButton("radiobutton.landscape",
                                      "orientLandscape.png", false,
                                      bg, this);
    rbLandscape.addActionListener(this);
    addToGB(rbLandscape, this, gridbag, c);
    rbRevPortrait = new IconRadioButton("radiobutton.revportrait",
                                        "orientRevPortrait.png", false,
                                        bg, this);
    rbRevPortrait.addActionListener(this);
    addToGB(rbRevPortrait, this, gridbag, c);
    rbRevLandscape = new IconRadioButton("radiobutton.revlandscape",
                                         "orientRevLandscape.png", false,
                                         bg, this);
    rbRevLandscape.addActionListener(this);
    addToGB(rbRevLandscape, this, gridbag, c);
}
 
源代码21 项目: arcusplatform   文件: ChangePinDialog.java
@Override
protected JPanel createContents() {
   submit.addActionListener((e) -> this.submit());
   Oculus.invokeOnEnter(newPin.getComponent(), () -> this.submit());

   JPanel panel = new JPanel();
   panel.setLayout(new GridBagLayout());

   GridBagConstraints gbc = new GridBagConstraints();
   gbc.gridy = 0;
   gbc.gridx = 0;
   gbc.weightx = 0;
   gbc.fill = GridBagConstraints.NONE;
   panel.add(newPin.getLabel(), gbc.clone());

   gbc.gridx = 1;
   gbc.weightx = 1.0;
   gbc.fill = GridBagConstraints.HORIZONTAL;
   panel.add(newPin.getComponent(), gbc.clone());

   gbc.gridy++;

   gbc.anchor = GridBagConstraints.NORTHEAST;
   gbc.weighty = 1.0;
   gbc.gridx = 1;
   gbc.fill = GridBagConstraints.NONE;

   panel.add(submit, gbc.clone());

   return panel;
}
 
源代码22 项目: openjdk-8-source   文件: PolicyTool.java
/**
 * displays a dialog box describing an error which occurred.
 */
void displayErrorDialog(Window w, String error) {
    ToolDialog ed = new ToolDialog
            (PolicyTool.getMessage("Error"), tool, this, true);

    // find where the PolicyTool gui is
    Point location = ((w == null) ?
            getLocationOnScreen() : w.getLocationOnScreen());
    //ed.setBounds(location.x + 50, location.y + 50, 600, 100);
    ed.setLayout(new GridBagLayout());

    JLabel label = new JLabel(error);
    addNewComponent(ed, label, 0,
                    0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);

    JButton okButton = new JButton(PolicyTool.getMessage("OK"));
    ActionListener okListener = new ErrorOKButtonListener(ed);
    okButton.addActionListener(okListener);
    addNewComponent(ed, okButton, 1,
                    0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);

    ed.getRootPane().setDefaultButton(okButton);
    ed.getRootPane().registerKeyboardAction(okListener, escKey, JComponent.WHEN_IN_FOCUSED_WINDOW);

    ed.pack();
    ed.setLocationRelativeTo(w);
    ed.setVisible(true);
}
 
源代码23 项目: openjdk-jdk9   文件: ServiceDialog.java
public PageSetupPanel() {
    super();

    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();

    setLayout(gridbag);

    c.fill = GridBagConstraints.BOTH;
    c.insets = panelInsets;
    c.weightx = 1.0;
    c.weighty = 1.0;

    c.gridwidth = GridBagConstraints.REMAINDER;
    pnlMedia = new MediaPanel();
    addToGB(pnlMedia, this, gridbag, c);

    pnlOrientation = new OrientationPanel();
    c.gridwidth = GridBagConstraints.RELATIVE;
    addToGB(pnlOrientation, this, gridbag, c);

    pnlMargins = new MarginsPanel();
    pnlOrientation.addOrientationListener(pnlMargins);
    pnlMedia.addMediaListener(pnlMargins);
    c.gridwidth = GridBagConstraints.REMAINDER;
    addToGB(pnlMargins, this, gridbag, c);
}
 
源代码24 项目: jdk8u-jdk   文件: ServiceDialog.java
public SidesPanel() {
    super();

    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();

    setLayout(gridbag);
    setBorder(BorderFactory.createTitledBorder(strTitle));

    c.fill = GridBagConstraints.BOTH;
    c.insets = compInsets;
    c.weighty = 1.0;
    c.gridwidth = GridBagConstraints.REMAINDER;

    ButtonGroup bg = new ButtonGroup();
    rbOneSide = new IconRadioButton("radiobutton.oneside",
                                    "oneside.png", true,
                                    bg, this);
    rbOneSide.addActionListener(this);
    addToGB(rbOneSide, this, gridbag, c);
    rbTumble = new IconRadioButton("radiobutton.tumble",
                                   "tumble.png", false,
                                   bg, this);
    rbTumble.addActionListener(this);
    addToGB(rbTumble, this, gridbag, c);
    rbDuplex = new IconRadioButton("radiobutton.duplex",
                                   "duplex.png", false,
                                   bg, this);
    rbDuplex.addActionListener(this);
    c.gridwidth = GridBagConstraints.REMAINDER;
    addToGB(rbDuplex, this, gridbag, c);
}
 
private void initialize()
{
  this.setPreferredSize(new Dimension(400, 50));
  this.setLayout(new GridBagLayout());
  GridBagConstraints c = new GridBagConstraints();
  c.fill = GridBagConstraints.HORIZONTAL;
  urlLabel = new JLabel("URL");
  c.weightx = 0.5;
  c.fill = GridBagConstraints.HORIZONTAL;
  c.gridx = 0;
  c.gridy = 0;
  this.add(urlLabel, c);
  urlTextField = new JTextField();
  c.fill = GridBagConstraints.HORIZONTAL;
  c.weightx = 0.5;
  c.gridwidth = 3;
  c.gridx = 1;
  c.gridy = 0;
  this.add(urlTextField, c);
  lock = new JButton("Lock");
  lock.addActionListener(controller);
  c.fill = GridBagConstraints.HORIZONTAL;
  c.weightx = 0.5;
  c.gridwidth = 1;
  c.gridx = 2;
  c.gridy = 1;
  this.add(lock, c);
  check = new JButton("Check");
  check.addActionListener(controller);
  c.fill = GridBagConstraints.HORIZONTAL;
  c.weightx = 0.5;
  c.gridwidth = 1;
  c.gridx = 3;
  c.gridy = 1;
  this.add(check, c);
}
 
源代码26 项目: Spark   文件: HistoryWindow.java
private void initLayout() {
	GridBagLayout layout = new GridBagLayout();
	setLayout(layout);

	GridBagConstraints c = new GridBagConstraints();

	c.anchor = GridBagConstraints.FIRST_LINE_START;
	c.fill = GridBagConstraints.HORIZONTAL;
	c.gridx = 0;
	c.gridy = 0;
	c.insets = new Insets(13, 13, 0, 13);
	add(getLabel(), c);

	c.anchor = GridBagConstraints.NORTHWEST;
	c.fill = GridBagConstraints.BOTH;
	c.gridx = 0;
	c.gridy = 1;
	c.weightx = 1;
	c.weighty = 1;
	add(getHistoryContentPanel(), c);

	c.anchor = GridBagConstraints.WEST;
	c.fill = GridBagConstraints.HORIZONTAL;
	c.gridx = 0;
	c.gridy = 2;
	c.weighty = 0;
	c.insets = new Insets(5, 13, 0, 13);

	add(getSizePanel(), c);

	c.anchor = GridBagConstraints.LAST_LINE_END;
	c.fill = GridBagConstraints.HORIZONTAL;
	c.gridx = 0;
	c.gridy = 3;
	c.insets = new Insets(0, 13, 5, 10);
	add(getButtonsPanel(), c);
}
 
源代码27 项目: jdk8u-dev-jdk   文件: ServiceDialog.java
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);
}
 
源代码28 项目: rapidminer-studio   文件: ANOVAMatrixViewer.java
public ANOVAMatrixViewer(ANOVAMatrix matrix) {
	super(new BorderLayout());

	JPanel panel = new JPanel(new GridBagLayout());
	panel.setOpaque(true);
	panel.setBackground(Colors.WHITE);

	GridBagConstraints gbc = new GridBagConstraints();
	gbc.gridx = 0;
	gbc.gridy = 0;
	gbc.weightx = 1.0;
	gbc.weighty = 1.0;
	gbc.fill = GridBagConstraints.BOTH;
	gbc.insets = new Insets(42, 10, 20, 10);

	// table
	ANOVAMatrixViewerTable table = new ANOVAMatrixViewerTable(matrix);
	table.getTableHeader().putClientProperty(RapidLookTools.PROPERTY_TABLE_HEADER_BACKGROUND, Colors.WHITE);
	((TableHeaderUI) table.getTableHeader().getUI()).installDefaults();
	table.setRowHighlighting(true);
	table.setRowHeight(PropertyPanel.VALUE_CELL_EDITOR_HEIGHT);

	JScrollPane scrollPane = new ExtendedJScrollPane(table);
	scrollPane.setBorder(null);
	scrollPane.setBackground(Colors.WHITE);
	scrollPane.getViewport().setBackground(Colors.WHITE);
	panel.add(scrollPane, gbc);

	// info string
	JLabel infoText = new JLabel();
	infoText.setText("A colored background indicates that the probability for non-difference between the groups is less than "
			+ Tools.formatNumber(matrix.getSignificanceLevel()));
	gbc.gridy += 1;
	gbc.insets = new Insets(5, 10, 5, 10);
	gbc.weighty = 0.0;
	gbc.fill = GridBagConstraints.HORIZONTAL;
	panel.add(infoText, gbc);

	add(panel, BorderLayout.CENTER);
}
 
源代码29 项目: ignite   文件: AboutDialog.java
/**
 * @return Grid bag constraints.
 */
private GridBagConstraints gbcSeparator() {
    gbc.gridx = 0;
    gbc.gridwidth = GridBagConstraints.REMAINDER;

    gbc.insets = new Insets(5, 10, 10, 10);

    return gbc;
}
 
源代码30 项目: arcusplatform   文件: Wizard.java
protected Wizard(WizardStep<I, ?> first, WizardStep<?, O> last) {
   this.first = first;
   this.current = first;
   this.last = last;

   GridBagConstraints gbc = new GridBagConstraints();
   
   gbc.gridx = 0;
   gbc.gridy = 0;
   gbc.fill = GridBagConstraints.BOTH;
   gbc.weightx = 1.0;
   gbc.weighty = 1.0;
   contents.add(new JLabel(), gbc.clone());
   
   gbc.fill = GridBagConstraints.HORIZONTAL;
   gbc.weightx = 1.0;
   gbc.weighty = 0.0;
   gbc.gridy++;
   contents.add(new JSeparator(JSeparator.HORIZONTAL), gbc.clone());
   
   JPanel buttons = new JPanel();
   buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
   buttons.add(back);
   buttons.add(Box.createHorizontalGlue());
   buttons.add(next);
   
   gbc.gridy++;
   contents.add(buttons, gbc.clone());
}
 
 类所在包
 同包方法