当前位置: 首页>>代码示例>>Java>>正文


Java GridBagConstraints.EAST属性代码示例

本文整理汇总了Java中java.awt.GridBagConstraints.EAST属性的典型用法代码示例。如果您正苦于以下问题:Java GridBagConstraints.EAST属性的具体用法?Java GridBagConstraints.EAST怎么用?Java GridBagConstraints.EAST使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.GridBagConstraints的用法示例。


在下文中一共展示了GridBagConstraints.EAST属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initializeLabels

private void initializeLabels() {
	this.lblRota = new JLabel("Rota");
	GridBagConstraints gbc_lblRota = new GridBagConstraints();
	gbc_lblRota.insets = new Insets(0, 0, 0, 5);
	gbc_lblRota.gridx = 9;
	gbc_lblRota.gridy = 3;
	this.panelFirst.add(this.lblRota, gbc_lblRota);

	this.lblNome = new JLabel("Nome:");
	GridBagConstraints gbc_lblNome = new GridBagConstraints();
	gbc_lblNome.anchor = GridBagConstraints.EAST;
	gbc_lblNome.insets = new Insets(0, 0, 5, 5);
	gbc_lblNome.gridx = 1;
	gbc_lblNome.gridy = 2;
	this.panelSecond.add(this.lblNome, gbc_lblNome);

	this.lblTipo = new JLabel("Tipo:");
	GridBagConstraints gbc_lblTipo = new GridBagConstraints();
	gbc_lblTipo.insets = new Insets(0, 0, 0, 5);
	gbc_lblTipo.anchor = GridBagConstraints.EAST;
	gbc_lblTipo.gridx = 1;
	gbc_lblTipo.gridy = 4;
	this.panelSecond.add(this.lblTipo, gbc_lblTipo);
}
 
开发者ID:cjlcarvalho,项目名称:LogisticApp,代码行数:24,代码来源:RotaFrame.java

示例2: initializeLabels

private void initializeLabels() {
	this.lblLocalidade = new JLabel("Localidade");
	GridBagConstraints gbc_lblLocalidade = new GridBagConstraints();
	gbc_lblLocalidade.insets = new Insets(0, 0, 5, 5);
	gbc_lblLocalidade.gridx = 6;
	gbc_lblLocalidade.gridy = 1;
	panelFirst.add(this.lblLocalidade, gbc_lblLocalidade);

	this.lblNome = new JLabel("Nome:");
	GridBagConstraints gbc_lblNome = new GridBagConstraints();
	gbc_lblNome.insets = new Insets(0, 0, 0, 5);
	gbc_lblNome.anchor = GridBagConstraints.EAST;
	gbc_lblNome.gridx = 2;
	gbc_lblNome.gridy = 5;
	panelSecond.add(this.lblNome, gbc_lblNome);
}
 
开发者ID:cjlcarvalho,项目名称:LogisticApp,代码行数:16,代码来源:LocalidadeFrame.java

示例3: addLabelTextRows

private void addLabelTextRows(JLabel[] labels, Component[] textFields,
		GridBagLayout gridbag, Container container) {
	GridBagConstraints c = new GridBagConstraints();
	c.anchor = GridBagConstraints.EAST;
	c.insets = new Insets(5, 5, 5, 5); // this statement added.
	int numLabels = labels.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; // reset to default
		container.add(labels[i], c);

		c.gridwidth = GridBagConstraints.REMAINDER; // end row
		c.fill = GridBagConstraints.HORIZONTAL;
		c.weightx = 1.0;
		container.add(textFields[i], c);
	}
}
 
开发者ID:skarna1,项目名称:javaportfolio,代码行数:19,代码来源:BaseDialog.java

示例4: addSwitchViewButton

/**
 * Adds the switchView button the the panel
 * 
 * @param gbc
 *          - the constraints used for this component
 */
private void addSwitchViewButton(GridBagConstraints gbc) {
	gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
			UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
	gbc.anchor = GridBagConstraints.EAST;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 2;
	gbc.gridy = 0;
	gbc.weightx = 0;
	gbc.weighty = 0;
	JToolBar toolbar = new JToolBar();
	switchViewButton = new ToolbarButton(null, false);
	switchViewButton.setToolTipText(translator.getTranslation(Tags.CHANGE_TREE_VIEW_BUTTON_TOOLTIP));
	URL resource = currentViewMode == ResourcesViewMode.FLAT_VIEW 
	    ? getClass().getResource(ImageConstants.TREE_VIEW)
	    : getClass().getResource(ImageConstants.TABLE_VIEW);
	if (resource != null) {
	  ImageIcon icon = (ImageIcon) imageUtilities.loadIcon(resource);
	  switchViewButton.setIcon(icon);
	}
	toolbar.add(switchViewButton);
	toolbar.setFloatable(false);
	toolbar.setOpaque(false);
	this.add(toolbar, gbc);

}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:31,代码来源:ChangesPanel.java

示例5: addFontChooser

private void addFontChooser(JComponent c, String displayName, FontChooser chooser) {
    GridBagLayout layout = (GridBagLayout)c.getLayout();
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.insets = new Insets(3, 3, 3, 3);
    constraints.weightx = 0.0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.EAST;
    JLabel label = new JLabel(displayName, JLabel.TRAILING);
    layout.setConstraints(label, constraints);
    c.add(label);
    constraints.insets = new Insets(3, 3, 3, 1);
    constraints.weightx = 1.0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(chooser.getPreview(), constraints);
    c.add(chooser.getPreview());
    constraints.insets = new Insets(3, 1, 3, 3);
    constraints.weightx = 0.0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.EAST;
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    layout.setConstraints(chooser.getButton(), constraints);
    c.add(chooser.getButton());
    elements.add(chooser);
    label.setLabelFor(chooser.getButton());
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:26,代码来源:CFGOptionsPanel.java

示例6: addBottomPanel

private void addBottomPanel(int gridY) {
	gbc = new GridBagConstraints();
	gbc.gridx = 0; gbc.gridy = gridY;
	gbc.insets = new Insets(5, 0, 5, 5);
	gbc.anchor = GridBagConstraints.EAST;
	getContentPane().add(bottomPanel, gbc);
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:7,代码来源:ProjectDialog.java

示例7: createGUI

/**
 * Sets the panel layout and creates all the buttons with their functionality
 * making them visible
 */
public void createGUI() {
	gitToolbar = new JToolBar();
	gitToolbar.setOpaque(false);
	gitToolbar.setFloatable(false);
	this.setLayout(new GridBagLayout());
	this.pushesAhead = GitAccess.getInstance().getPushesAhead();
	this.pullsBehind = GitAccess.getInstance().getPullsBehind();

	GridBagConstraints gbc = new GridBagConstraints();
	gbc.insets = new Insets(0, 0, 0, 0);
	gbc.anchor = GridBagConstraints.WEST;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 0;
	gbc.gridy = 0;
	gbc.weightx = 0;
	gbc.weighty = 0;
	addCloneRepositoryButton();
	addPushAndPullButtons();
	addBranchSelectButton();
	addSubmoduleSelectButton();
	if (gitRepoHasSubmodules()) {
		submoduleSelectButton.setEnabled(true);
	} else {
		submoduleSelectButton.setEnabled(false);
	}
	this.add(gitToolbar, gbc);

	gbc.insets = new Insets(0, 0, 0, 0);
	gbc.anchor = GridBagConstraints.EAST;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 1;
	gbc.gridy = 0;
	gbc.weightx = 1;
	gbc.weighty = 0;
	updateStatus();
	this.add(statusInformationLabel, gbc);

	this.setMinimumSize(new Dimension(UIConstants.PANEL_WIDTH, UIConstants.TOOLBAR_PANEL_HEIGHT));
}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:43,代码来源:ToolbarPanel.java

示例8: addCommitButton

private void addCommitButton(GridBagConstraints gbc) {
	gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
			UIConstants.COMPONENT_BOTTOM_PADDING, UIConstants.COMPONENT_RIGHT_PADDING);
	gbc.anchor = GridBagConstraints.EAST;
	gbc.fill = GridBagConstraints.NONE;
	gbc.gridx = 1;
	gbc.gridy = 3;
	gbc.weightx = 1;
	gbc.weighty = 0;
	commitButton = new JButton(translator.getTranslation(Tags.COMMIT_BUTTON_TEXT));
	toggleCommitButton(false);
	this.add(commitButton, gbc);
}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:13,代码来源:CommitPanel.java

示例9: createPanel

private JPanel createPanel() {
//out("Create Main panel");
        JPanel p = new JPanel(new GridBagLayout());
        JPanel panel = new JPanel(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();

        // navigate
        c.anchor = GridBagConstraints.WEST;
        c.insets = new Insets(0, 0, 0, TINY_SIZE);
        p.add(createNavigatePanel(), c);

        // scale
        c.weightx = 1.0;
        c.weighty = 0.0;
        c.insets = new Insets(0, 0, 0, 0);
        p.add(createScalePanel(), c);

        // toggle
        c.anchor = GridBagConstraints.EAST;
        c.insets = new Insets(TINY_SIZE, HUGE_SIZE, TINY_SIZE, 0);
        myToggle = createToggleButton(
            new ButtonAction(icon(Config.class, "toggle"), i18n("TLT_Toggle")) { // NOI18N
                public void actionPerformed(ActionEvent event) {
                    toggle();
                }
            }
        );
        myToggle.addKeyListener(myKeyListener);
        myToggle.setSelected(true);
        p.add(myToggle, c);

        c.gridx = 0;
        c.gridy = 0;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.anchor = GridBagConstraints.WEST;
        c.insets = new Insets(HUGE_SIZE, 0, HUGE_SIZE, 0);
        panel.add(p, c);

        // scroll
        c.gridy++;
        c.weightx = 1.0;
        c.weighty = 1.0;
        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(0, 0, 0, 0);
        panel.add(createScrollPanel(), c);
//      panel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.green));

        toggle();

        return panel;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:51,代码来源:Preview.java

示例10: PartPanel

private PartPanel(final PartObj part)
{
	this.part = part;

	setLayout(new GridBagLayout());
	setBorder(BorderFactory.createLineBorder(Color.black));

	GridBagConstraints c = new GridBagConstraints();
	c.insets = new Insets(0,3,0,3);
	c.anchor = GridBagConstraints.CENTER;
	c.gridx = 0;
	c.gridy = 0;
	c.weightx = 1;
	add(new JLabel(part.getDisplayName()),c);

	c.gridx = 1;
	c.weightx = 0;
	c.anchor = GridBagConstraints.EAST;
	JTextField textField = new JTextField(part.getDisplayName());
	textField.getDocument().addDocumentListener(new DisplayNameDocumentListener(part, textField));
	textField.setPreferredSize(new Dimension(200,22));
	add(textField, c);

	c.gridx = 2;
	c.weightx = 0;
	box = new JComboBox();
	box.setPreferredSize(new Dimension(200,20));
	box.addActionListener(new GroupDropDownActionListener(part));
	box.setSelectedItem(controller.getPartGroups().getPartGroup(part));
	add(box, c);

	c.weightx = 0;
	c.gridx = 3;
	DragPanel dp = new DragPanel(this);
	c.anchor = GridBagConstraints.EAST;
	add(dp, c);

	//Mouse listener to highlight part when panel entered.
	addMouseListener(new BlankMouseListener()
	{
		@Override
		public void mouseEntered(MouseEvent e) 
		{
			controller.setSelectedPart(part);
		}
	});
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:47,代码来源:EntitySetupPartPanel.java

示例11: initializeLabels

private void initializeLabels() {
	this.lblOrigem = new JLabel("Origem:");
	GridBagConstraints gbc_lblOrigem = new GridBagConstraints();
	gbc_lblOrigem.insets = new Insets(0, 0, 5, 5);
	gbc_lblOrigem.anchor = GridBagConstraints.EAST;
	gbc_lblOrigem.gridx = 2;
	gbc_lblOrigem.gridy = 3;
	this.panel.add(this.lblOrigem, gbc_lblOrigem);

	this.lblDestino = new JLabel("Destino:");
	GridBagConstraints gbc_lblDestino = new GridBagConstraints();
	gbc_lblDestino.anchor = GridBagConstraints.EAST;
	gbc_lblDestino.insets = new Insets(0, 0, 5, 5);
	gbc_lblDestino.gridx = 2;
	gbc_lblDestino.gridy = 8;
	this.panel.add(this.lblDestino, gbc_lblDestino);

	this.lblCapacidadeTotal = new JLabel("<html><p align=\"right\">Capacidade Total (KG):</p></html>");
	this.lblCapacidadeTotal.setVerticalAlignment(SwingConstants.TOP);
	GridBagConstraints gbc_lblCapacidadeTotal = new GridBagConstraints();
	gbc_lblCapacidadeTotal.anchor = GridBagConstraints.EAST;
	gbc_lblCapacidadeTotal.insets = new Insets(0, 0, 5, 5);
	gbc_lblCapacidadeTotal.gridx = 2;
	gbc_lblCapacidadeTotal.gridy = 13;
	this.panel.add(this.lblCapacidadeTotal, gbc_lblCapacidadeTotal);

	this.lblCustoPorGrama = new JLabel(
			"<html><p align=\"right\" style=\"word-wrap: break-word;\">Custo&nbsp;por Grama&nbsp;(R$):</p></html>");
	GridBagConstraints gbc_lblCustoPorGrama = new GridBagConstraints();
	gbc_lblCustoPorGrama.anchor = GridBagConstraints.EAST;
	gbc_lblCustoPorGrama.insets = new Insets(0, 0, 5, 5);
	gbc_lblCustoPorGrama.gridx = 2;
	gbc_lblCustoPorGrama.gridy = 18;
	this.panel.add(this.lblCustoPorGrama, gbc_lblCustoPorGrama);

	this.lblTempoDeEntrega = new JLabel(
			"<html><p align=\"right\" style=\"word-wrap: break-word;\">Qtd.&nbsp;de&nbsp;dias&nbsp;p/ entrega:</p></html>");
	GridBagConstraints gbc_lblTempoDeEntrega = new GridBagConstraints();
	gbc_lblTempoDeEntrega.anchor = GridBagConstraints.EAST;
	gbc_lblTempoDeEntrega.insets = new Insets(0, 0, 5, 5);
	gbc_lblTempoDeEntrega.gridx = 2;
	gbc_lblTempoDeEntrega.gridy = 23;
	this.panel.add(this.lblTempoDeEntrega, gbc_lblTempoDeEntrega);
}
 
开发者ID:cjlcarvalho,项目名称:LogisticApp,代码行数:44,代码来源:DiretaPanelBuilder.java

示例12: initializeLabels

private void initializeLabels() {
	this.lblContrataoDeTransporte = new JLabel("Contratação de Transporte");
	GridBagConstraints gbc_lblContrataoDeTransporte = new GridBagConstraints();
	gbc_lblContrataoDeTransporte.gridx = 3;
	gbc_lblContrataoDeTransporte.gridy = 1;
	this.panelFirst.add(this.lblContrataoDeTransporte, gbc_lblContrataoDeTransporte);

	this.lblEscolhaALocalidadeOrigem = new JLabel("Escolha a localidade origem:");
	GridBagConstraints gbc_lblEscolhaALocalidade = new GridBagConstraints();
	gbc_lblEscolhaALocalidade.gridwidth = 10;
	gbc_lblEscolhaALocalidade.insets = new Insets(0, 0, 5, 0);
	gbc_lblEscolhaALocalidade.gridx = 2;
	gbc_lblEscolhaALocalidade.gridy = 1;
	this.panelSecond.add(this.lblEscolhaALocalidadeOrigem, gbc_lblEscolhaALocalidade);

	this.lblSelecione = new JLabel("Selecione:");
	GridBagConstraints gbc_lblSelecione = new GridBagConstraints();
	gbc_lblSelecione.anchor = GridBagConstraints.EAST;
	gbc_lblSelecione.insets = new Insets(0, 0, 5, 5);
	gbc_lblSelecione.gridx = 2;
	gbc_lblSelecione.gridy = 3;
	this.panelSecond.add(this.lblSelecione, gbc_lblSelecione);

	this.lblEscolhaALocalidadeDestino = new JLabel("Escolha a localidade destino:");
	GridBagConstraints gbc_lblEscolhaALocalidade_1 = new GridBagConstraints();
	gbc_lblEscolhaALocalidade_1.gridwidth = 10;
	gbc_lblEscolhaALocalidade_1.insets = new Insets(0, 0, 5, 0);
	gbc_lblEscolhaALocalidade_1.gridx = 2;
	gbc_lblEscolhaALocalidade_1.gridy = 5;
	this.panelSecond.add(this.lblEscolhaALocalidadeDestino, gbc_lblEscolhaALocalidade_1);

	this.lblSelecione_1 = new JLabel("Selecione:");
	GridBagConstraints gbc_lblSelecione_1 = new GridBagConstraints();
	gbc_lblSelecione_1.anchor = GridBagConstraints.EAST;
	gbc_lblSelecione_1.insets = new Insets(0, 0, 5, 5);
	gbc_lblSelecione_1.gridx = 2;
	gbc_lblSelecione_1.gridy = 7;
	this.panelSecond.add(this.lblSelecione_1, gbc_lblSelecione_1);

	this.lblPeso = new JLabel("Peso (KG):");
	GridBagConstraints gbc_lblPeso = new GridBagConstraints();
	gbc_lblPeso.gridwidth = 10;
	gbc_lblPeso.insets = new Insets(0, 0, 5, 0);
	gbc_lblPeso.gridx = 2;
	gbc_lblPeso.gridy = 9;
	this.panelSecond.add(this.lblPeso, gbc_lblPeso);
}
 
开发者ID:cjlcarvalho,项目名称:LogisticApp,代码行数:47,代码来源:MenuContratacaoTransporteFrame.java

示例13: XiaoShouPaiHang

public XiaoShouPaiHang() {
	setIconifiable(true);
	setClosable(true);
	setTitle("��������");
	getContentPane().setLayout(new GridBagLayout());
	setBounds(100, 100, 650, 375);

	final JLabel label_1 = new JLabel();
	label_1.setText("��");
	final GridBagConstraints gridBagConstraints_8 = new GridBagConstraints();
	gridBagConstraints_8.anchor = GridBagConstraints.EAST;
	gridBagConstraints_8.gridy = 0;
	gridBagConstraints_8.gridx = 0;
	getContentPane().add(label_1, gridBagConstraints_8);

	year = new JComboBox();
	for (int i = 1981, j = 0; i <= date.get(Calendar.YEAR) + 1; i++, j++) {
		year.addItem(i);
		if (i == date.get(Calendar.YEAR))
			year.setSelectedIndex(j);
	}
	year.setPreferredSize(new Dimension(100, 21));
	setupComponet(year, 1, 0, 1, 90, true);

	setupComponet(new JLabel("��"), 2, 0, 1, 1, false);

	month = new JComboBox();
	for (int i = 1; i <= 12; i++) {
		month.addItem(String.format("%02d", i));
		if (date.get(Calendar.MONTH) == i)
			month.setSelectedIndex(i - 1);
	}
	month.setPreferredSize(new Dimension(100, 21));
	setupComponet(month, 3, 0, 1, 30, true);

	setupComponet(new JLabel(" �·ݵ�������Ϣ����"), 4, 0, 1, 1, false);
	condition = new JComboBox();
	condition.setModel(new DefaultComboBoxModel(new String[]{"���", "����"}));
	setupComponet(condition, 5, 0, 1, 30, true);

	setupComponet(new JLabel(" ����"), 6, 0, 1, 1, false);

	operation = new JComboBox();
	operation.setModel(new DefaultComboBoxModel(
			new String[]{"��������", "��������"}));
	setupComponet(operation, 7, 0, 1, 30, true);

	okButton = new JButton();
	okButton.addActionListener(new OkAction());
	setupComponet(okButton, 8, 0, 1, 1, false);
	okButton.setText("ȷ��");

	final JScrollPane scrollPane = new JScrollPane();
	final GridBagConstraints gridBagConstraints_6 = new GridBagConstraints();
	gridBagConstraints_6.weighty = 1.0;
	gridBagConstraints_6.anchor = GridBagConstraints.NORTH;
	gridBagConstraints_6.insets = new Insets(0, 10, 5, 10);
	gridBagConstraints_6.fill = GridBagConstraints.BOTH;
	gridBagConstraints_6.gridwidth = 9;
	gridBagConstraints_6.gridy = 1;
	gridBagConstraints_6.gridx = 0;
	getContentPane().add(scrollPane, gridBagConstraints_6);

	table = new JTable();
	table.setEnabled(false);
	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	dftm = (DefaultTableModel) table.getModel();
	String[] tableHeads = new String[]{"��Ʒ���", "��Ʒ����", "���۽��", "��������",
			"���", "����", "��λ", "���", "��װ", "����", "��׼�ĺ�","���","��Ӧ��"};
	dftm.setColumnIdentifiers(tableHeads);
	scrollPane.setViewportView(table);
}
 
开发者ID:Edward7Zhang,项目名称:SuperMarketManageSystem,代码行数:72,代码来源:XiaoShouPaiHang.java

示例14: NewPortfolioDialog

public NewPortfolioDialog(Component frameComp, Component locationComp,
		String title) {
	super(JOptionPane.getFrameForComponent(frameComp), title, true);

	// Create and initialize the buttons.
	cancelButton = new JButton(BUTTON_CANCEL);
	cancelButton.addActionListener(this);
	cancelButton.setActionCommand(BUTTON_CANCEL);

	okButton = new JButton(BUTTON_OK);
	okButton.setActionCommand(BUTTON_OK);
	okButton.addActionListener(this);
	getRootPane().setDefaultButton(okButton);
	
	nameFieldLabel = new JLabel("Salkun nimi: ");
	nameFieldLabel.setLabelFor(nameField);
	
	JPanel textControlsPane = new JPanel(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.anchor = GridBagConstraints.EAST;
	c.insets = new Insets(5, 5, 5, 5); // this statement added.
	
	textControlsPane.add(nameFieldLabel,c);
	textControlsPane.add(nameField,c);
	
	// Lay out the buttons from left to right.
	JPanel buttonPane = new JPanel();
	buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS));
	buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
	buttonPane.add(Box.createHorizontalGlue());
	buttonPane.add(cancelButton);
	buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
	buttonPane.add(okButton);
	
	// Put everything together, using the content pane's BorderLayout.
	Container contentPane = getContentPane();
	contentPane.add(textControlsPane, BorderLayout.CENTER);
	contentPane.add(buttonPane, BorderLayout.PAGE_END);

	pack();
	setLocationRelativeTo(locationComp);
	setVisible(true);
}
 
开发者ID:skarna1,项目名称:javaportfolio,代码行数:43,代码来源:NewPortfolioDialog.java

示例15: OpenPortfolioDialog

public OpenPortfolioDialog(Component frameComp, Component locationComp,
		String title, Object[] portfolios) {
	super(JOptionPane.getFrameForComponent(frameComp), title, true);

	// Create and initialize the buttons.
	cancelButton = new JButton(BUTTON_CANCEL);
	cancelButton.addActionListener(this);
	cancelButton.setActionCommand(BUTTON_CANCEL);

	okButton = new JButton(BUTTON_OK);
	okButton.setActionCommand(BUTTON_OK);
	okButton.addActionListener(this);
	getRootPane().setDefaultButton(okButton);
	
	portfolioList = new JComboBox(portfolios);
	portfolioFieldLabel = new JLabel("Salkun nimi: ");
	portfolioFieldLabel.setLabelFor(portfolioList);
	
	JPanel textControlsPane = new JPanel(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.anchor = GridBagConstraints.EAST;
	c.insets = new Insets(10, 10, 10, 10); // this statement added.
	
	textControlsPane.add(portfolioFieldLabel,c);
	textControlsPane.add(portfolioList, c);
	
	// Lay out the buttons from left to right.
	JPanel buttonPane = new JPanel();
	buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS));
	buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
	buttonPane.add(Box.createHorizontalGlue());
	buttonPane.add(cancelButton);
	buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
	buttonPane.add(okButton);
	
	// Put everything together, using the content pane's BorderLayout.
	Container contentPane = getContentPane();
	contentPane.add(textControlsPane, BorderLayout.CENTER);
	contentPane.add(buttonPane, BorderLayout.PAGE_END);

	pack();
	setLocationRelativeTo(locationComp);
	setVisible(true);
}
 
开发者ID:skarna1,项目名称:javaportfolio,代码行数:44,代码来源:OpenPortfolioDialog.java


注:本文中的java.awt.GridBagConstraints.EAST属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。