本文整理匯總了Java中javax.swing.GroupLayout.setVerticalGroup方法的典型用法代碼示例。如果您正苦於以下問題:Java GroupLayout.setVerticalGroup方法的具體用法?Java GroupLayout.setVerticalGroup怎麽用?Java GroupLayout.setVerticalGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.GroupLayout
的用法示例。
在下文中一共展示了GroupLayout.setVerticalGroup方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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))
);
}
示例2: 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())
);
}
示例3: createCustomEditorGUI
import javax.swing.GroupLayout; //導入方法依賴的package包/類
@Override
protected Component createCustomEditorGUI(Component resourcePanelGUI) {
if (resourcePanelGUI == null && ResourceSupport.isResourceableProperty(property)) {
// not usable for full resourcing, only for internationalization
// add a NOI18N checkbox so the user can mark the property as not to be internationalized
Component customEd = delegateEditor.getCustomEditor();
JPanel panel = new JPanel();
GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
noI18nCheckbox = new JCheckBox();
Mnemonics.setLocalizedText(noI18nCheckbox, NbBundle.getMessage(StringEditor.class, "CTL_NOI18NCheckBox")); // NOI18N
noI18nCheckbox.getAccessibleContext().setAccessibleDescription(
NbBundle.getBundle(
StringEditor.class).getString("ACD_NOI18NCheckBox")); //NOI18N
layout.setHorizontalGroup(layout.createParallelGroup()
.addComponent(customEd)
.addGroup(layout.createSequentialGroup()
.addContainerGap().addComponent(noI18nCheckbox).addContainerGap()));
layout.setVerticalGroup(layout.createSequentialGroup()
.addComponent(customEd).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(noI18nCheckbox));
return panel;
}
else {
noI18nCheckbox = null;
return super.createCustomEditorGUI(resourcePanelGUI);
}
}
示例4: createTextPanelPlaceholder
import javax.swing.GroupLayout; //導入方法依賴的package包/類
private JPanel createTextPanelPlaceholder() {
JPanel placeholder = new JPanel();
placeholder.setBackground(blueBackground);
GroupLayout layout = new GroupLayout(placeholder);
placeholder.setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, ICON_WIDTH, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));
return placeholder;
}
示例5: ProgressDialog
import javax.swing.GroupLayout; //導入方法依賴的package包/類
/**
* Create the dialog.
*/
public ProgressDialog() {
setBounds(100, 100, 450, 141);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
lblStatus = new JLabel("Status: Initializing");
lblStatus.setFont(new Font("Tahoma", Font.PLAIN, 12));
pb = new JProgressBar();
GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
gl_contentPanel
.setHorizontalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING,
gl_contentPanel.createSequentialGroup().addContainerGap()
.addGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING)
.addComponent(pb, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 404,
Short.MAX_VALUE)
.addComponent(lblStatus, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 404,
Short.MAX_VALUE))
.addContainerGap()));
gl_contentPanel.setVerticalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPanel.createSequentialGroup().addContainerGap().addComponent(lblStatus)
.addPreferredGap(ComponentPlacement.RELATED).addComponent(pb, GroupLayout.DEFAULT_SIZE, 28,
Short.MAX_VALUE)));
contentPanel.setLayout(gl_contentPanel);
{
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane, BorderLayout.SOUTH);
{
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dispose();
}
});
cancelButton.setActionCommand("Cancel");
buttonPane.add(cancelButton);
}
}
}
示例6: 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);
}
示例7: 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);
}
示例8: ActionsBuilder
import javax.swing.GroupLayout; //導入方法依賴的package包/類
public ActionsBuilder (JPanel panel, FocusListener listener) {
this.focusListener = listener;
panel.removeAll();
GroupLayout layout = (GroupLayout) panel.getLayout();
horizontalSeqGroup = layout.createSequentialGroup();
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(horizontalSeqGroup)
);
verticalParallelGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(verticalParallelGroup)
);
}
示例9: layoutComponents
import javax.swing.GroupLayout; //導入方法依賴的package包/類
private void layoutComponents() {
JLabel titleLabel = new JLabel("Please enter the credentials for " + url);
int em = getFontMetrics(getFont()).stringWidth("m");
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setAutoCreateGaps(true);
groupLayout.setHorizontalGroup(groupLayout.createParallelGroup()
.addComponent(titleLabel)
.addComponent(usernamePassword)
.addGroup(groupLayout.createSequentialGroup().addGap(3 * em)
.addGroup(groupLayout.createParallelGroup().addComponent(usernameLabel)
.addComponent(passwordLabel))
.addGroup(groupLayout.createParallelGroup()
.addComponent(username, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
GroupLayout.PREFERRED_SIZE)
.addComponent(password, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
GroupLayout.PREFERRED_SIZE)))
.addComponent(anonymous));
groupLayout.setVerticalGroup(groupLayout.createSequentialGroup()
.addComponent(titleLabel).addComponent(usernamePassword)
.addGroup(
groupLayout.createBaselineGroup(true, false).addComponent(usernameLabel).addComponent(username))
.addGroup(
groupLayout.createBaselineGroup(true, false).addComponent(passwordLabel).addComponent(password))
.addComponent(anonymous));
setLayout(groupLayout);
}
示例10: WidthHeightPanel
import javax.swing.GroupLayout; //導入方法依賴的package包/類
WidthHeightPanel(boolean showWidth, boolean showHeight) {
ResourceBundle bundle = NbBundle.getBundle(BoxFillerInitializer.class);
JLabel widthLabel = new JLabel(bundle.getString("BoxFillerInitializer.width")); // NOI18N
JLabel heightLabel = new JLabel(bundle.getString("BoxFillerInitializer.height")); // NOI18N
widthField = new JSpinner(new SpinnerNumberModel());
heightField = new JSpinner(new SpinnerNumberModel());
GroupLayout layout = new GroupLayout(this);
setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
.addComponent(widthLabel)
.addComponent(heightLabel))
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(widthField)
.addComponent(heightField))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(widthLabel)
.addComponent(widthField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(heightLabel)
.addComponent(heightField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
widthLabel.setVisible(showWidth);
heightLabel.setVisible(showHeight);
widthField.setVisible(showWidth);
heightField.setVisible(showHeight);
}
示例11: 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;
}
示例12: SearchingProgressDialog
import javax.swing.GroupLayout; //導入方法依賴的package包/類
/**
* Create the dialog.
*/
public SearchingProgressDialog() {
setTitle("Doing web search");
setBounds(100, 100, 394, 124);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
handler = new SearchingProgressHandler() {
@Override
public boolean onStart() {
lblStatus.setText("Status: Search started. Waiting request to response...");
pb.setIndeterminate(false);
return true;
}
@Override
public boolean onPause() {
return true;
}
@Override
public boolean onLoopStart() {
return true;
}
@Override
public boolean onLoopEnd() {
lblStatus.setText("Status: Relieving result. Completed: " + this.getCompletedPages() + "/" + this.getTotalPages() + " Total result: " + this.getBeatmapIndexed());
pb.setValue((int) ((float) this.getCompletedPages() / this.getTotalPages() * 100));
return true;
}
@Override
public boolean onError() {
lblStatus.setText("Status: Errored!");
lblStatus.setForeground(Color.RED);
JOptionPane.showMessageDialog(SearchingProgressDialog.this, "Error occurred! Please check error dumps under \"osumer2 -> View Dumps\"", "Error", JOptionPane.ERROR_MESSAGE);
dispose();
return false;
}
@Override
public boolean onComplete() {
lblStatus.setText("Status: Completed. Total result: " + this.getBeatmapIndexed());
return true;
}
};
lblStatus = new JLabel("Status: Waiting to start...");
lblStatus.setFont(new Font("Tahoma", Font.PLAIN, 12));
pb = new JProgressBar();
pb.setIndeterminate(true);
GroupLayout groupLayout = new GroupLayout(getContentPane());
groupLayout.setHorizontalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
.addContainerGap()
.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
.addComponent(pb, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 358, Short.MAX_VALUE)
.addComponent(lblStatus, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE))
.addContainerGap())
);
groupLayout.setVerticalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addContainerGap()
.addComponent(lblStatus)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(pb, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
.addContainerGap(43, Short.MAX_VALUE))
);
getContentPane().setLayout(groupLayout);
}
示例13: 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();
}
示例14: QuickLoginPanel
import javax.swing.GroupLayout; //導入方法依賴的package包/類
/**
* Create the panel.
*/
public QuickLoginPanel() {
JLabel lblNoConfigurationFound = new JLabel("No configuration found for logging in.");
lblNoConfigurationFound.setFont(new Font("PMingLiU", Font.BOLD, 12));
lblNoConfigurationFound.setForeground(Color.RED);
lblNoConfigurationFound.setHorizontalAlignment(SwingConstants.CENTER);
JLabel lblAnOsuAccount = new JLabel("An osu! account is required to download beatmaps.");
lblAnOsuAccount.setHorizontalAlignment(SwingConstants.CENTER);
JLabel lblYourLoginInformation = new JLabel(
"Your login information will only used for logging in to osu! forum.");
lblYourLoginInformation.setHorizontalAlignment(SwingConstants.CENTER);
JLabel lblSeeGithubProjects = new JLabel("See GitHub project's disclaimer for more details.");
lblSeeGithubProjects.setHorizontalAlignment(SwingConstants.CENTER);
JLabel lblUsername = new JLabel("Username:");
usrFld = new JTextField();
usrFld.setColumns(10);
JLabel lblPassword = new JLabel("Password:");
pwdFld = new JPasswordField();
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup().addContainerGap()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(lblAnOsuAccount, GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
.addComponent(lblNoConfigurationFound, GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)
.addComponent(lblYourLoginInformation, GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE)
.addComponent(lblSeeGithubProjects, GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE)
.addGroup(groupLayout
.createSequentialGroup().addGroup(groupLayout
.createParallelGroup(Alignment.TRAILING, false)
.addComponent(lblPassword, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblUsername, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(pwdFld, GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
.addComponent(usrFld, GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE))))
.addContainerGap()));
groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(lblNoConfigurationFound)
.addPreferredGap(ComponentPlacement.RELATED).addComponent(lblAnOsuAccount)
.addPreferredGap(ComponentPlacement.RELATED).addComponent(lblYourLoginInformation)
.addPreferredGap(ComponentPlacement.RELATED).addComponent(lblSeeGithubProjects)
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(lblUsername)
.addComponent(usrFld))
.addPreferredGap(ComponentPlacement.RELATED).addGroup(groupLayout
.createParallelGroup(Alignment.BASELINE).addComponent(lblPassword).addComponent(pwdFld))
.addGap(13)));
setLayout(groupLayout);
}
示例15: DecorMobPanel
import javax.swing.GroupLayout; //導入方法依賴的package包/類
/**
* Create the panel.
*/
public DecorMobPanel() {
TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_decorMob"), TitledBorder.LEADING, TitledBorder.TOP, null, null);
border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
setBorder(border);
JLabel lblSprite = new JLabel(Resources.get("panel_sprite"));
comboBoxSpriteSheets = new JComboBox<>();
comboBoxSpriteSheets.setRenderer(new MyComboRenderer());
JLabel lblBehaviour = new JLabel(Resources.get("panel_behavior"));
comboBoxBehaviour = new JComboBox<>();
comboBoxBehaviour.setModel(new DefaultComboBoxModel<MovementBehavior>(MovementBehavior.values()));
lblVvelocity = new JLabel(Resources.get("panel_velocity"));
spinnerVelocity = new JSpinner();
spinnerVelocity.setModel(new SpinnerNumberModel(0, 0, 100, 1));
chckbxAttackable = new JCheckBox(Resources.get("panel_attackable"));
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addContainerGap()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lblSprite, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(comboBoxSpriteSheets, 0, 95, Short.MAX_VALUE)
.addGap(10))
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lblBehaviour, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(comboBoxBehaviour, 0, 95, Short.MAX_VALUE)
.addContainerGap())
.addGroup(groupLayout.createSequentialGroup()
.addComponent(lblVvelocity, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(chckbxAttackable, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(28))
.addComponent(spinnerVelocity, GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE))
.addContainerGap()))));
groupLayout.setVerticalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(lblSprite, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
.addComponent(comboBoxSpriteSheets, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(ComponentPlacement.UNRELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
.addComponent(lblBehaviour, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
.addComponent(comboBoxBehaviour, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(ComponentPlacement.UNRELATED)
.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
.addComponent(lblVvelocity, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)
.addComponent(spinnerVelocity, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(ComponentPlacement.UNRELATED)
.addComponent(chckbxAttackable)
.addContainerGap(171, Short.MAX_VALUE)));
setLayout(groupLayout);
this.setupChangedListeners();
}