當前位置: 首頁>>代碼示例>>Java>>正文


Java GridBagConstraints.HORIZONTAL屬性代碼示例

本文整理匯總了Java中java.awt.GridBagConstraints.HORIZONTAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java GridBagConstraints.HORIZONTAL屬性的具體用法?Java GridBagConstraints.HORIZONTAL怎麽用?Java GridBagConstraints.HORIZONTAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.GridBagConstraints的用法示例。


在下文中一共展示了GridBagConstraints.HORIZONTAL屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initialize

/**
 * 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);
	}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:28,代碼來源:DBQueryPanel.java

示例2: addLeftRightComponents

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);
		}
}
 
開發者ID:etomica,項目名稱:etomica,代碼行數:23,代碼來源:ViewAlkaneLengthSelection.java

示例3: initialize

/**
 * 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);
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:22,代碼來源:DynFormText.java

示例4: initialize

/**
 * 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);

}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:26,代碼來源:EnvironmentModel.java

示例5: initComponents

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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:SectionSeparator.java

示例6: addSeperator

public static void addSeperator(JPanel panel, GridBagConstraints c) {
    Insets orig_insets = c.insets;
    c.insets = new Insets(0, 0, 0, 0);
    c.gridwidth = 2;
    c.gridheight = 1;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 0;
    panel.add(Box.createVerticalStrut(5), c);
    c.gridx = 0;
    c.gridy++;
    panel.add(new JSeparator(), c);
    c.gridx = 0;
    c.gridy++;
    panel.add(Box.createVerticalStrut(5), c);
    c.insets = orig_insets;
    return;
}
 
開發者ID:s-store,項目名稱:s-store,代碼行數:18,代碼來源:AbstractViewer.java

示例7: addProbability

/**
 * Add a probability to an interval Panel If the probability is for
 * interval B the value is displayed as 1-probability
 * 
 * @param intervalPanel
 *            the intervalPanel
 * @param intervalA
 *            if the probability is for interval A or B
 */
protected void addProbability(Container intervalPanel, boolean intervalA) {
	JLabel probLabel = new JLabel(PROBABILITY);
	JTextField probValue = new JTextField();
	Double probability = (Double) current.getParameter(0).getValue();

	// If the interval is interval A display value directly
	// Otherwise display 1-probability
	if (intervalA) {
		probValue.setName(PROBABILITY_INTERVAL_A);
	} else {
		probability = new Double(1 - probability.doubleValue());
		probValue.setName(PROBABILITY_INTERVAL_B);
	}
	probValue.setText(probability.toString());
	probLabel.setLabelFor(probValue);

	probValue.addFocusListener(new ProbabilityAdapter());
	probValue.addKeyListener(new ProbabilityAdapter());

	GridBagConstraints c = new GridBagConstraints();
	c.gridwidth = GridBagConstraints.RELATIVE; // next-to-last
	c.fill = GridBagConstraints.NONE; // reset to default
	c.weightx = 0.0; // reset to default
	c.weighty = 1.0;
	intervalPanel.add(probLabel, c);

	c.gridwidth = GridBagConstraints.REMAINDER; // end row
	c.fill = GridBagConstraints.HORIZONTAL;
	c.weightx = 1.0;
	c.weighty = 1.0;
	intervalPanel.add(probValue, c);
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:41,代碼來源:DistributionsEditor.java

示例8: setupComponet

private void setupComponet(JComponent component, int gridx, int gridy,
		int gridwidth, int ipadx, boolean fill) {
	final GridBagConstraints gridBagConstrains = new GridBagConstraints();
	gridBagConstrains.gridx = gridx;
	gridBagConstrains.gridy = gridy;
	if (gridwidth > 1)
		gridBagConstrains.gridwidth = gridwidth;
	if (ipadx > 0)
		gridBagConstrains.ipadx = ipadx;
	gridBagConstrains.insets = new Insets(5, 1, 3, 1);
	if (fill)
		gridBagConstrains.fill = GridBagConstraints.HORIZONTAL;
	add(component, gridBagConstrains);
}
 
開發者ID:Edward7Zhang,項目名稱:SuperMarketManageSystem,代碼行數:14,代碼來源:KeHuXiuGaiPanel.java

示例9: CopiesPanel

public CopiesPanel() {
    super();

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

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

    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = compInsets;

    lblCopies = new JLabel(getMsg("label.numcopies"), JLabel.TRAILING);
    lblCopies.setDisplayedMnemonic(getMnemonic("label.numcopies"));
    lblCopies.getAccessibleContext().setAccessibleName(
                                     getMsg("label.numcopies"));
    addToGB(lblCopies, this, gridbag, c);

    snModel = new SpinnerNumberModel(1, 1, 999, 1);
    spinCopies = new JSpinner(snModel);
    lblCopies.setLabelFor(spinCopies);
    // REMIND
    ((JSpinner.NumberEditor)spinCopies.getEditor()).getTextField().setColumns(3);
    spinCopies.addChangeListener(this);
    c.gridwidth = GridBagConstraints.REMAINDER;
    addToGB(spinCopies, this, gridbag, c);

    cbCollate = createCheckBox("checkbox.collate", this);
    cbCollate.setEnabled(false);
    addToGB(cbCollate, this, gridbag, c);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:31,代碼來源:ServiceDialog.java

示例10: setupComponet

private void setupComponet(JComponent component, int gridx, int gridy,
		int gridwidth, int ipadx, boolean fill) {
	final GridBagConstraints gridBagConstrains = new GridBagConstraints();
	gridBagConstrains.gridx = gridx;
	gridBagConstrains.gridy = gridy;
	if (gridwidth > 1)
		gridBagConstrains.gridwidth = gridwidth;
	if (ipadx > 0)
		gridBagConstrains.ipadx = ipadx;
	gridBagConstrains.insets = new Insets(5, 1, 3, 1);
	if (fill)
		gridBagConstrains.fill = GridBagConstraints.HORIZONTAL;
	getContentPane().add(component, gridBagConstrains);
}
 
開發者ID:Edward7Zhang,項目名稱:SuperMarketManageSystem,代碼行數:14,代碼來源:KeHuChaXun.java

示例11: initializeComboBoxes

private void initializeComboBoxes() {
	this.cbxTipo = new JComboBox<String>();
	this.setComboBoxContent(this.cbxTipo);
	this.cbxTipo.addActionListener(this);
	GridBagConstraints gbc_comboBox = new GridBagConstraints();
	gbc_comboBox.fill = GridBagConstraints.HORIZONTAL;
	gbc_comboBox.gridx = 3;
	gbc_comboBox.gridy = 4;
	this.panelSecond.add(this.cbxTipo, gbc_comboBox);
}
 
開發者ID:cjlcarvalho,項目名稱:LogisticApp,代碼行數:10,代碼來源:RotaFrame.java

示例12: insertValue

private void insertValue(JComponent value) {
    GridBagConstraints c = new GridBagConstraints();
    c.gridy = nextrow++;
    c.anchor = GridBagConstraints.PAGE_START;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridx = 1;
    c.weightx = 1.0;
    c.ipady = 5;
    c.ipadx = 10;
    add(value, c);
}
 
開發者ID:The-Retired-Programmer,項目名稱:nbreleaseplugin,代碼行數:11,代碼來源:VersionUpdaterPanel.java

示例13: createBottom

private Component createBottom() {
    final JPanel panel = new JPanel(new GridLayout(1, 4, 5, 0));
    panel.add(bBack);
    panel.add(bNext);
    panel.add(bCancel);
    panel.add(bFinish);

    final JPanel p = new JPanel(new FlowLayout());

    p.add(panel);

    final JPanel res = new JPanel(new GridBagLayout());
    final GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    final JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
    p1.add(etap);

    c.weightx = 1.0;
    c.gridx = 0;
    c.gridy = 0;

    res.add(p1, c);

    c.weightx = 0;
    c.gridx = 1;
    c.gridy = 0;

    res.add(p, c);

    return res;
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:31,代碼來源:MainPanel.java

示例14: setupComponet

private void setupComponet(JComponent component, int gridx, int gridy,
		int gridwidth, int ipadx, boolean fill) {
	final GridBagConstraints gridBagConstrains = new GridBagConstraints();
	gridBagConstrains.gridx = gridx;
	gridBagConstrains.gridy = gridy;
	gridBagConstrains.insets = new Insets(5, 1, 3, 1);
	if (gridwidth > 1)
		gridBagConstrains.gridwidth = gridwidth;
	if (ipadx > 0)
		gridBagConstrains.ipadx = ipadx;
	if (fill)
		gridBagConstrains.fill = GridBagConstraints.HORIZONTAL;
	add(component, gridBagConstrains);
}
 
開發者ID:Edward7Zhang,項目名稱:SuperMarketManageSystem,代碼行數:14,代碼來源:KeHuTianJiaPanel.java

示例15: addCommentField

private void addCommentField(String text, int gridwidth) {
    commentField = new JTextField(text);
    commentField.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            commentUpdated();
        }
    });
    GridBagConstraints gridConstraints = new GridBagConstraints();
    gridConstraints.gridy = 1;
    gridConstraints.gridwidth = gridwidth;
    gridConstraints.fill = GridBagConstraints.HORIZONTAL;
    add(commentField, gridConstraints);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:WatchAnnotationProvider.java


注:本文中的java.awt.GridBagConstraints.HORIZONTAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。