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


Java GroupLayout類代碼示例

本文整理匯總了Java中javax.swing.GroupLayout的典型用法代碼示例。如果您正苦於以下問題:Java GroupLayout類的具體用法?Java GroupLayout怎麽用?Java GroupLayout使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: configureHorizontalLayout

import javax.swing.GroupLayout; //導入依賴的package包/類
private void configureHorizontalLayout(GroupLayout groupLayout) {
	groupLayout.setHorizontalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
					.addComponent(tagEditLbl, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
					.addComponent(editTagLbl, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
					.addComponent(projectLbl, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE))
				.addGap(18)
				.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
					.addGroup(groupLayout.createSequentialGroup()
						.addComponent(saveBtn, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE)
						.addGap(47)
						.addComponent(removeBtn, GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE))
					.addComponent(projectBox, 0, 282, Short.MAX_VALUE)
					.addComponent(editTagTxtField, GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE)
					.addComponent(tagSelectBox, 0, 352, Short.MAX_VALUE))
				.addContainerGap())
	);
}
 
開發者ID:ser316asu,項目名稱:Neukoelln_SER316,代碼行數:22,代碼來源:EditProjectTagDialog.java

示例2: initComponents

import javax.swing.GroupLayout; //導入依賴的package包/類
private void initComponents(JScrollPane tablePane, FindInQueryBar findBar) {
    GroupLayout layout = new GroupLayout(component);
    component.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addComponent(findBar, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addComponent(tablePane, GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addComponent(tablePane, GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE)
            .addGap(0, 0, 0)
            .addComponent(findBar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
    );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:IssueTable.java

示例3: configureVerticalLayout

import javax.swing.GroupLayout; //導入依賴的package包/類
private void configureVerticalLayout(GroupLayout groupLayout) {
	groupLayout.setVerticalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(projectLbl, GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE)
					.addComponent(projectBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(editTagLbl, GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE)
					.addComponent(tagSelectBox, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
				.addPreferredGap(ComponentPlacement.UNRELATED)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(tagEditLbl, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
					.addComponent(editTagTxtField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				.addGap(18)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(saveBtn, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)
					.addComponent(removeBtn, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE))
				.addGap(11))
	);
}
 
開發者ID:ser316asu,項目名稱:Neukoelln_SER316,代碼行數:24,代碼來源:EditProjectTagDialog.java

示例4: CollisionBoxPanel

import javax.swing.GroupLayout; //導入依賴的package包/類
public CollisionBoxPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_collisionBox"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  chckbxIsObstacle = new JCheckBox(Resources.get("panel_isObstacle"));

  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addComponent(chckbxIsObstacle, GroupLayout.PREFERRED_SIZE, 108, GroupLayout.PREFERRED_SIZE)
              .addContainerGap(322, Short.MAX_VALUE)));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addComponent(chckbxIsObstacle, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)
              .addContainerGap(258, Short.MAX_VALUE)));
  setLayout(groupLayout);

  this.setupChangedListeners();
}
 
開發者ID:gurkenlabs,項目名稱:litiengine,代碼行數:24,代碼來源:CollisionBoxPanel.java

示例5: FormLayoutHelper

import javax.swing.GroupLayout; //導入依賴的package包/類
public FormLayoutHelper(JPanel panel, Column... columns) {

        this.panel = panel;
        layout = new GroupLayout(panel);
        panel.setLayout(layout);

        horizontalGroup = layout.createSequentialGroup();
        verticalGroup = layout.createSequentialGroup();

        this.columns = columns;
        columnGroups = new Group[columns.length];

        for (int i = 0; i < columns.length; i++) {
            Group columnGroup = columns[i].createParallelGroup(layout);
            columnGroups[i] = columnGroup;
            horizontalGroup.addGroup(columnGroup);
        }

        layout.setHorizontalGroup(horizontalGroup);
        layout.setVerticalGroup(verticalGroup);
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:FormLayoutHelper.java

示例6: addAction

import javax.swing.GroupLayout; //導入依賴的package包/類
private void addAction (Action action) {
    String name = (String) action.getValue(Action.NAME);
    LinkButton btn = new LinkButton(name);
    btn.addActionListener(action);
    btn.addFocusListener(focusListener);
    
    if (notEmpty) {
        JLabel separator = new javax.swing.JLabel();
        separator.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createEmptyBorder(2, 0, 2, 0),
                BorderFactory.createLineBorder(Color.BLACK, 1)
        ));
        horizontalSeqGroup
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(separator)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
        verticalParallelGroup
            .addComponent(separator, GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
    }
    
    horizontalSeqGroup
            .addComponent(btn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    verticalParallelGroup
            .addComponent(btn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    notEmpty = true;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:CollapsibleSectionPanel.java

示例7: addAction

import javax.swing.GroupLayout; //導入依賴的package包/類
private void addAction (Action action) {
    String name = (String) action.getValue(Action.NAME);
    LinkButton btn = new LinkButton(name);
    btn.addActionListener(action);
    
    if (notEmpty) {
        JLabel separator = new javax.swing.JLabel();
        separator.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createEmptyBorder(2, 0, 2, 0),
                BorderFactory.createLineBorder(Color.BLACK, 1)
        ));
        horizontalSeqGroup
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(separator)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
        verticalParallelGroup
            .addComponent(separator, GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
    }
    
    horizontalSeqGroup
            .addComponent(btn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    verticalParallelGroup
            .addComponent(btn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    notEmpty = true;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:26,代碼來源:SectionPanel.java

示例8: createCustomEditorGUI

import javax.swing.GroupLayout; //導入依賴的package包/類
protected Component createCustomEditorGUI(Component resourcePanelGUI) {
    if (resourcePanelGUI == null)
        return delegateEditor.getCustomEditor();

    JPanel panel = new JPanel();
    Component delComp = delegateEditor.getCustomEditor();
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setHorizontalGroup(layout.createParallelGroup()
            .addComponent(delComp)
            .addGroup(layout.createSequentialGroup()
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(resourcePanelGUI)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)));
    layout.setVerticalGroup(layout.createSequentialGroup()
            .addComponent(delComp).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(resourcePanelGUI));

    return panel;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:ResourceWrapperEditor.java

示例9: initComponents

import javax.swing.GroupLayout; //導入依賴的package包/類
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    innerPanel = new JPanel();

    innerPanel.setLayout(new BorderLayout());

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(innerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(innerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addContainerGap())
    );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:29,代碼來源:CustomizerOptionsPanel.java

示例10: getVerticalGroup

import javax.swing.GroupLayout; //導入依賴的package包/類
private GroupLayout.ParallelGroup getVerticalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) {
    GroupLayout.ParallelGroup res = layout.createParallelGroup (/* XXX huh? GroupLayout.PREFERRED_SIZE*/);
    GroupLayout.SequentialGroup seq = layout.createSequentialGroup ();
    if (hasPrimary) {
        seq.addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 40, 40)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addComponent (tpPrimaryPlugins, GroupLayout.PREFERRED_SIZE, tpPrimaryPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addGap (0, 30, 30);
    }
    if (hasRequired) {
        seq.addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 80, 80)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
                .addComponent (tpDependingPlugins, GroupLayout.PREFERRED_SIZE, tpDependingPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED);
    }
    res.addGroup (seq);
    return res;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:OperationDescriptionPanel.java

示例11: getHorizontalGroup

import javax.swing.GroupLayout; //導入依賴的package包/類
private GroupLayout.ParallelGroup getHorizontalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) {
    GroupLayout.ParallelGroup res = layout.createParallelGroup (Alignment.LEADING);
    if (hasPrimary) {
        res.addGroup (Alignment.TRAILING, layout.createSequentialGroup ()
                .addGroup (layout.createParallelGroup (Alignment.TRAILING)
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addGap (49, 49, 49)
                .addComponent (tpPrimaryPlugins, GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE))
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addContainerGap ()
                .addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)))
                .addContainerGap ());
    }
    if (hasRequired) {
        res.addGroup (Alignment.TRAILING, layout.createSequentialGroup ()
                .addGroup (layout.createParallelGroup (Alignment.TRAILING)
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addGap (49, 49, 49)
                .addComponent (tpDependingPlugins, GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE))
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addContainerGap ()
                .addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)))
                .addContainerGap ());
    }
    return res;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:OperationDescriptionPanel.java

示例12: init

import javax.swing.GroupLayout; //導入依賴的package包/類
private void init() {
    errorLabel.setText(" "); // NOI18N
    GroupLayout containerPanelLayout = new GroupLayout(containerPanel);
    containerPanel.setLayout(containerPanelLayout);
    GroupLayout.ParallelGroup horizontalGroup = containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    GroupLayout.SequentialGroup verticalGroup = containerPanelLayout.createSequentialGroup();
    containerPanelLayout.setHorizontalGroup(horizontalGroup);
    containerPanelLayout.setVerticalGroup(
        containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(verticalGroup)
    );
    for (CssPreprocessorUIImplementation.Options options : allOptions) {
        JComponent component = options.getComponent();
        Parameters.notNull("component", component); // NOI18N
        horizontalGroup.addComponent(component, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
        verticalGroup.addComponent(component, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:CssPrepOptionsPanel.java

示例13: searchingPanel

import javax.swing.GroupLayout; //導入依賴的package包/類
private static JPanel searchingPanel(JLabel progressLabel, JComponent progressComponent) {
    JPanel panel = new JPanel();
    progressLabel.setLabelFor(progressComponent);
    javax.swing.GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                .addComponent(progressLabel, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(progressComponent, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(96, 96, 96)
            .addComponent(progressLabel)
            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(progressComponent, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(109, Short.MAX_VALUE))
    );
    return panel;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:26,代碼來源:SwingAppLibDownloader.java

示例14: QuickSearchPanel

import javax.swing.GroupLayout; //導入依賴的package包/類
public QuickSearchPanel(FileObject referenceFile, RepositoryFilter filter) {
    initComponents();
    
    newButton = createNewRepoButton();
    ((GroupLayout) getLayout()).replace(jLabel1, newButton);
    newButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            onNewRepo();
        }
    });
    this.referenceFile = referenceFile;
    
    qs = new QuickSearchComboBar(this);
    issuePanel.add(qs, BorderLayout.NORTH);
    issueLabel.setLabelFor(qs);
    
    if (referenceFile != null) {
        RepositoryComboSupport.setup(this, repositoryComboBox, filter, referenceFile);
    } else {
        RepositoryComboSupport.setup(this, repositoryComboBox, filter, false);
    }
    repositoryComboBox.addItemListener(this);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:QuickSearchPanel.java

示例15: initializeGroupLayout

import javax.swing.GroupLayout; //導入依賴的package包/類
private void initializeGroupLayout() {
	GroupLayout groupLayout = new GroupLayout(contentPane);

	groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
			.createSequentialGroup()
			.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
					.addGroup(groupLayout.createSequentialGroup().addContainerGap()
							.addComponent(this.btnContratacao, GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE))
					.addGroup(groupLayout.createSequentialGroup().addGap(79).addComponent(this.btnCadastro,
							GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE)))
			.addContainerGap())
			.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup().addContainerGap(45, Short.MAX_VALUE)
					.addComponent(this.lblTitle, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE)
					.addGap(40)));

	groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
			.createSequentialGroup().addGap(33)
			.addComponent(this.lblTitle, GroupLayout.PREFERRED_SIZE, 41, GroupLayout.PREFERRED_SIZE).addGap(39)
			.addComponent(btnCadastro, GroupLayout.PREFERRED_SIZE, 41, GroupLayout.PREFERRED_SIZE).addGap(33)
			.addComponent(this.btnContratacao, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
			.addContainerGap(47, Short.MAX_VALUE)));

	this.contentPane.setLayout(groupLayout);
}
 
開發者ID:cjlcarvalho,項目名稱:LogisticApp,代碼行數:25,代碼來源:MenuFrame.java


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