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


Java GroupLayout.setHorizontalGroup方法代碼示例

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


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

示例1: 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

示例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: 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

示例4: 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

示例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: 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

示例7: 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

示例8: resetLayout

import javax.swing.GroupLayout; //導入方法依賴的package包/類
private void resetLayout() {
    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setAutoCreateContainerGaps(true);
    layout.setHorizontalGroup(layout.createSequentialGroup()
        .addComponent(headerLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
        .addGap(3)
        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane, GroupLayout.PREFERRED_SIZE, 320, Short.MAX_VALUE)
            .addComponent(typeField))
        .addGap(3)
        .addComponent(footerLabel));        
    
           
    int prefHeight;
    int maxHeight;
    if(jScrollPane.getPreferredSize().getHeight() > 300) {
        prefHeight = 300;
        maxHeight = GroupLayout.DEFAULT_SIZE;
    } else {
        prefHeight = GroupLayout.DEFAULT_SIZE;
        maxHeight = GroupLayout.PREFERRED_SIZE;
    }
    
    layout.setVerticalGroup(layout.createSequentialGroup()
        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(jScrollPane.getInsets().top)
                .addGroup(layout.createParallelGroup().addComponent(headerLabel).addComponent(footerLabel)))
            .addComponent(jScrollPane, GroupLayout.DEFAULT_SIZE, prefHeight, maxHeight))
        .addComponent(typeField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:33,代碼來源:CodeCustomEditor.java

示例9: layoutComponents

import javax.swing.GroupLayout; //導入方法依賴的package包/類
private void layoutComponents() {
    JScrollPane printTextScrollPane = new JScrollPane(appendTextInput);
    printTextScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

    JSeparator separator1 = new JSeparator();

    JScrollPane readLineTextScrollPane = new JScrollPane(readLineOutput);
    readLineTextScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

    JSeparator separator2 = new JSeparator();

    JScrollPane consoleScrollPane = new JScrollPane(consoleText);
    consoleScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setAutoCreateContainerGaps(true);
    groupLayout.setAutoCreateGaps(true);
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup().addComponent(printTextScrollPane)
            .addComponent(appendText, Alignment.TRAILING).addComponent(separator1)
            .addComponent(readLine, Alignment.TRAILING).addComponent(readLineTextScrollPane)
            .addComponent(separator2).addComponent(consoleScrollPane));

    groupLayout.setVerticalGroup(groupLayout.createSequentialGroup()
            .addComponent(printTextScrollPane, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.PREFERRED_SIZE)
            .addComponent(appendText)
            .addComponent(separator1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.PREFERRED_SIZE)
            .addComponent(readLine)
            .addComponent(readLineTextScrollPane, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.PREFERRED_SIZE)
            .addComponent(separator2, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.PREFERRED_SIZE)
            .addComponent(consoleScrollPane));
    setLayout(groupLayout);
}
 
開發者ID:pascalgn,項目名稱:jiracli,代碼行數:37,代碼來源:ConsoleTextAreaDemo.java

示例10: GridEditPanel

import javax.swing.GroupLayout; //導入方法依賴的package包/類
public GridEditPanel(int rasterSize) {

    JLabel lblSize = new JLabel("size (px)");
    lblSize.setFont(Program.TEXT_FONT.deriveFont(Font.BOLD).deriveFont(10f));

    textField = new JFormattedTextField(NumberFormat.getIntegerInstance());

    textField.setText("16");
    textField.setFont(Program.TEXT_FONT.deriveFont(10f));
    textField.setColumns(10);
    textField.setValue(rasterSize);
    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblSize, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(textField, GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                .addGap(34)));
    groupLayout.setVerticalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(lblSize, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                    .addComponent(textField, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
                .addContainerGap(46, Short.MAX_VALUE)));
    setLayout(groupLayout);
  }
 
開發者ID:gurkenlabs,項目名稱:litiengine,代碼行數:31,代碼來源:GridEditPanel.java

示例11: layoutHeaderPanel

import javax.swing.GroupLayout; //導入方法依賴的package包/類
private void layoutHeaderPanel(JPanel headerPanel, JLabel iconLabel, JLabel leftLabel, JLabel commentLabel, JLabel rightLabel, LinkButton replyButton, LinkButton mailtoButton, JLabel stateLabel) {
    GroupLayout layout = new GroupLayout(headerPanel);
    headerPanel.setLayout(layout);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup()
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(stateLabel);
    }
    hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(commentLabel,0, 0, Short.MAX_VALUE)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(rightLabel)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(mailtoButton);
    }
    layout.setHorizontalGroup(hGroup);
    
    GroupLayout.ParallelGroup vGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        vGroup.addComponent(stateLabel);
    }
    vGroup.addComponent(commentLabel)
          .addComponent(rightLabel)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        vGroup.addComponent(mailtoButton);
    }
    layout.setVerticalGroup(vGroup);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:37,代碼來源:CommentsPanel.java

示例12: getTableCellRendererComponent

import javax.swing.GroupLayout; //導入方法依賴的package包/類
@Override
public Component getTableCellRendererComponent(JTable table,
		Object value, boolean isSelected, boolean hasFocus, int row,
		int column) {

	JPanel panel = new JPanel();
	if (value instanceof String[]) {
		String[] valueArray = (String[]) value;
		if (valueArray.length == 0)
			return panel;
		GroupLayout layout = new GroupLayout(panel);
		panel.setLayout(layout);
		layout.setAutoCreateGaps(true);
		layout.setAutoCreateContainerGaps(true);
		SequentialGroup cols = layout.createSequentialGroup();
		layout.setHorizontalGroup(cols);
		ParallelGroup col1 = layout
				.createParallelGroup(GroupLayout.Alignment.LEADING);
		ParallelGroup col2 = layout
				.createParallelGroup(GroupLayout.Alignment.TRAILING);
		cols.addGroup(col1)
				.addPreferredGap(
						LayoutStyle.ComponentPlacement.RELATED,
						GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
				.addGroup(col2);
		SequentialGroup rows = layout.createSequentialGroup();
		layout.setVerticalGroup(rows);
		for (int i = 0; i < valueArray.length; i++) {
			// the value array has null elements for
			// IdResource/Demand
			if (valueArray[i] != null) {
				/* TODO: Fix ArrayIndexOutofBounds Exception here 
				 * Update: Problem is actually above. Probably linked to resources without setters. */
				//System.out.println("ValueArray: " + valueArray[i]);
				//for (int j = 0; j < resParamNames.size(); j++) { System.out.println("resParamNames: " + resParamNames.get(j)); }
				JLabel label = new JLabel();
				if (resParamNames.get(row).length == 0)
					label.setText("max. param");
				else
					label.setText("max. " + resParamNames.get(row)[i]);
				JTextField tf = new JTextField(3);
				tf.setText(valueArray[i]);
				col1.addComponent(label);
				col2.addComponent(tf, GroupLayout.PREFERRED_SIZE,
						GroupLayout.DEFAULT_SIZE,
						GroupLayout.PREFERRED_SIZE);
				rows.addGroup(layout
						.createParallelGroup(
								GroupLayout.Alignment.CENTER)
						.addComponent(label).addComponent(tf));
			}
		}
	}
	table.setRowHeight(row, Math.max(table.getRowHeight(row),
			(int) panel.getPreferredSize().getHeight()));
	TableColumn cm = table.getColumnModel().getColumn(column);
	cm.setMinWidth(Math.max(cm.getMinWidth(), (int) panel
			.getPreferredSize().getWidth()));
	return panel;
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:61,代碼來源:ConstraintsGeneratorDialog.java

示例13: getTableCellEditorComponent

import javax.swing.GroupLayout; //導入方法依賴的package包/類
@Override
public Component getTableCellEditorComponent(JTable table,
		Object value, boolean isSelected, int row, int column) {
	panel = new JPanel();
	if (value instanceof String[]) {
		String[] valueArray = (String[]) value;
		if (valueArray.length == 0)
			return panel;
		GroupLayout layout = new GroupLayout(panel);
		panel.setLayout(layout);
		layout.setAutoCreateGaps(true);
		layout.setAutoCreateContainerGaps(true);
		SequentialGroup cols = layout.createSequentialGroup();
		layout.setHorizontalGroup(cols);
		ParallelGroup col1 = layout
				.createParallelGroup(GroupLayout.Alignment.LEADING);
		ParallelGroup col2 = layout
				.createParallelGroup(GroupLayout.Alignment.TRAILING);
		cols.addGroup(col1)
				.addPreferredGap(
						LayoutStyle.ComponentPlacement.RELATED,
						GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
				.addGroup(col2);
		SequentialGroup rows = layout.createSequentialGroup();
		layout.setVerticalGroup(rows);

		for (int i = 0; i < valueArray.length; i++) {
			// create the label. use the resource param name for both
			// resource and demand params as it should be the same. TODO
			JLabel label = new JLabel();
			if (resParamNames.get(row).length == 0)
				label.setText("max. param");
			else
				label.setText("max. " + resParamNames.get(row)[i]);
			JTextField tf = new JTextField(3);
			tf.setText(valueArray[i]);
			tf.setEditable(true);
			col1.addComponent(label);
			col2.addComponent(tf, GroupLayout.PREFERRED_SIZE,
					GroupLayout.DEFAULT_SIZE,
					GroupLayout.PREFERRED_SIZE);
			rows.addGroup(layout
					.createParallelGroup(GroupLayout.Alignment.CENTER)
					.addComponent(label).addComponent(tf));
		}
	}
	table.setRowHeight(row, Math.max(table.getRowHeight(row),
			(int) panel.getPreferredSize().getHeight()));
	TableColumn cm = table.getColumnModel().getColumn(column);
	cm.setMinWidth(Math.max(cm.getMinWidth(), (int) panel
			.getPreferredSize().getWidth()));
	return panel;
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:54,代碼來源:ConstraintsGeneratorDialog.java

示例14: SpawnpointPanel

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

  JLabel lblShadowType = new JLabel(Resources.get("panel_entity"));

  textFieldType = new JTextField();
  textFieldType.setColumns(10);

  JLabel lblDirection = new JLabel(Resources.get("panel_direction"));

  comboBoxDirection = new JComboBox<>();
  comboBoxDirection.setModel(new DefaultComboBoxModel<Direction>(Direction.values()));

  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(textFieldType, GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE))
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblDirection, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(comboBoxDirection, 0, 371, Short.MAX_VALUE)))
              .addGap(4)));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(textFieldType, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblDirection, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxDirection, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
              .addContainerGap(226, Short.MAX_VALUE)));
  setLayout(groupLayout);

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

示例15: ResultBeatmapCell

import javax.swing.GroupLayout; //導入方法依賴的package包/類
/**
 * Create the panel.
 */
public ResultBeatmapCell() {
    
    lblImg = new JLabel("Loading thumb...");
    lblImg.setFont(new Font("Tahoma", Font.PLAIN, 12));
    lblImg.setHorizontalAlignment(SwingConstants.CENTER);
    
    lblName = new JLabel("---");
    lblName.setFont(new Font("Tahoma", Font.PLAIN, 18));
    
    lblCreator = new JLabel("---");
    lblCreator.setFont(new Font("Tahoma", Font.PLAIN, 12));
    
    lblTags = new JLabel("Tags:");
    lblTags.setFont(new Font("Tahoma", Font.PLAIN, 12));
    
    lblStatus = new JLabel("---");
    lblStatus.setFont(new Font("Tahoma", Font.PLAIN, 12));
    lblStatus.setHorizontalAlignment(SwingConstants.CENTER);
    
    lblMoreDetails = new JLabel("Click to see more details.");
    lblMoreDetails.setFont(new Font("Tahoma", Font.PLAIN, 12));
    lblMoreDetails.setHorizontalAlignment(SwingConstants.CENTER);
    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblImg, GroupLayout.PREFERRED_SIZE, 166, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addComponent(lblCreator, GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
                    .addComponent(lblName, GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
                    .addComponent(lblTags, GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
                    .addComponent(lblStatus, GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
                    .addComponent(lblMoreDetails, GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE))
                .addContainerGap())
    );
    groupLayout.setVerticalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addGroup(groupLayout.createSequentialGroup()
                        .addComponent(lblName)
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addComponent(lblCreator)
                        .addPreferredGap(ComponentPlacement.UNRELATED)
                        .addComponent(lblTags)
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addComponent(lblStatus)
                        .addPreferredGap(ComponentPlacement.RELATED)
                        .addComponent(lblMoreDetails))
                    .addComponent(lblImg, GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE))
                .addContainerGap())
    );
    setLayout(groupLayout);

}
 
開發者ID:mob41,項目名稱:osumer,代碼行數:62,代碼來源:ResultBeatmapCell.java


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