当前位置: 首页>>代码示例>>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;未经允许,请勿转载。