本文整理汇总了Java中javax.swing.GroupLayout.Alignment类的典型用法代码示例。如果您正苦于以下问题:Java Alignment类的具体用法?Java Alignment怎么用?Java Alignment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Alignment类属于javax.swing.GroupLayout包,在下文中一共展示了Alignment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureHorizontalLayout
import javax.swing.GroupLayout.Alignment; //导入依赖的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())
);
}
示例2: configureVerticalLayout
import javax.swing.GroupLayout.Alignment; //导入依赖的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))
);
}
示例3: CollisionBoxPanel
import javax.swing.GroupLayout.Alignment; //导入依赖的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();
}
示例4: getHorizontalGroup
import javax.swing.GroupLayout.Alignment; //导入依赖的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;
}
示例5: initializeGroupLayout
import javax.swing.GroupLayout.Alignment; //导入依赖的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);
}
示例6: TextPanel
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
/**
* Create the panel.
*/
public TextPanel(String text) {
JLabel lblUpdateChangelog = new JLabel("Update description/change-log:");
JScrollPane scrollPane = new JScrollPane();
JLabel lblDoYouWant = new JLabel("Do you want to install this update?");
lblDoYouWant.setFont(new Font("Tahoma", Font.PLAIN, 15));
lblDoYouWant.setHorizontalAlignment(SwingConstants.CENTER);
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(
groupLayout.createParallelGroup(Alignment.TRAILING)
.addGroup(groupLayout.createSequentialGroup()
.addContainerGap()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE)
.addComponent(lblUpdateChangelog, GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE)
.addComponent(lblDoYouWant, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE))
.addContainerGap())
);
groupLayout.setVerticalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addContainerGap()
.addComponent(lblUpdateChangelog)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(lblDoYouWant)
.addContainerGap())
);
JTextArea textArea = new JTextArea();
scrollPane.setViewportView(textArea);
setLayout(groupLayout);
textArea.setEditable(false);
textArea.setText(text);
}
示例7: grlay
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
private void grlay(final JPanel panel) {
final GroupLayout layout = new GroupLayout(panel);
// panel.setBorder(BorderFactory.createTitledBorder("Nastvit nickVzorky popisků: " + SestavovacPopisku.getNahrazovaceDisplay()));
panel.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
// panel.add(jKesPatternEdit);
// panel.add(jWaymarkPatternEdit);
// panel.add(jCgpPatternEdit);
// panel.add(jSimplewaypontPatternEdit);
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER).addGroup(layout.createParallelGroup() // hroup
.addComponent(jZpravy).addGroup(layout.createSequentialGroup().addComponent(jPredchozi).addComponent(jDalsi).addComponent(jPrecteno))));
layout.setVerticalGroup(layout.createSequentialGroup() // hroup
.addComponent(jZpravy).addGroup(layout.createParallelGroup().addComponent(jDalsi).addComponent(jPredchozi).addComponent(jPrecteno)));
}
示例8: initComponents
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
private void initComponents()
{
digitalPanel = new JPanel();
analogPanel = new JPanel();
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(analogPanel, GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE).addComponent(digitalPanel,
GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE))
.addGap(0)));
groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup().addComponent(analogPanel, GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE)
.addPreferredGap(ComponentPlacement.RELATED).addComponent(digitalPanel, GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
.addGap(0)));
setLayout(groupLayout);
}
示例9: Log
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
/**
* Create the frame.
*/
public Log() {
setBounds(100, 100, 319, 290);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
JScrollPane scrollPane = new JScrollPane();
GroupLayout gl_contentPane = new GroupLayout(contentPane);
gl_contentPane.setHorizontalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(scrollPane, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
);
textArea = new JTextArea();
scrollPane.setViewportView(textArea);
textArea.setLineWrap(true);
contentPane.setLayout(gl_contentPane);
}
示例10: BackgroundProgress
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
/** Build the dialog. */
public BackgroundProgress() {
setTitle("Work in background");
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setModal(true);
label = new JLabel("Working...");
progress = new JProgressBar();
progress.setIndeterminate(true);
Container c = getContentPane();
GroupLayout gl = new GroupLayout(c);
c.setLayout(gl);
gl.setAutoCreateContainerGaps(true);
gl.setAutoCreateGaps(true);
gl.setHorizontalGroup(gl.createParallelGroup(Alignment.CENTER)
.addComponent(label).addComponent(progress));
gl.setVerticalGroup(gl.createSequentialGroup().addComponent(label).addComponent(progress));
pack();
setResizable(false);
}
示例11: JKeyBindingPanel
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
public JKeyBindingPanel(FrameKeyBindings parent, KeyBinding.Type type, KeyBinding binding) {
this.parent = parent;
JLabel label = new JLabel(" " + type.toString());
label.setPreferredSize(new Dimension(5000, 50));
label.setBorder(BorderFactory.createLineBorder(Color.gray));
btn = new JKeyBindingButton(this, type, binding);
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addGroup(groupLayout.createSequentialGroup()
.addComponent(label, GroupLayout.PREFERRED_SIZE, 152, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(btn, GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE))
);
groupLayout.setVerticalGroup(
groupLayout.createParallelGroup(Alignment.LEADING)
.addComponent(label, GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
.addComponent(btn, GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
);
setLayout(groupLayout);
}
示例12: getPanelPregunta
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
public JPanel getPanelPregunta() {
if (panelPregunta == null) {
panelPregunta = new JPanel();
panelPregunta.setBorder(new EmptyBorder(4, 6, 4, 6));
GroupLayout gl_panelPregunta = new GroupLayout(panelPregunta);
gl_panelPregunta
.setHorizontalGroup(gl_panelPregunta.createParallelGroup(Alignment.LEADING)
.addGroup(gl_panelPregunta.createSequentialGroup()
.addComponent(getPanelLetra(), GroupLayout.PREFERRED_SIZE, 58,
GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED)
.addComponent(getScrollPane(), GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)
.addGap(1)));
gl_panelPregunta.setVerticalGroup(gl_panelPregunta.createParallelGroup(Alignment.LEADING)
.addGroup(gl_panelPregunta.createSequentialGroup()
.addGroup(gl_panelPregunta.createParallelGroup(Alignment.LEADING)
.addComponent(getPanelLetra(), GroupLayout.PREFERRED_SIZE, 48,
GroupLayout.PREFERRED_SIZE)
.addComponent(getScrollPane(), GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE))
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
panelPregunta.setLayout(gl_panelPregunta);
}
return panelPregunta;
}
示例13: initialize
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
private void initialize() {
setResizable(false);
setTitle("Instrucciones de juego");
setBounds(100, 100, 450, 300);
GroupLayout groupLayout = new GroupLayout(getContentPane());
groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addComponent(getTextPane(),
GroupLayout.DEFAULT_SIZE, 444, Short.MAX_VALUE));
groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addComponent(getTextPane(),
GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));
getContentPane().setLayout(groupLayout);
// Centrar la ventana
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension windowSize = this.getSize();
if (windowSize.height > screenSize.height)
windowSize.height = screenSize.height;
if (windowSize.width > screenSize.width)
windowSize.width = screenSize.width;
setLocation((screenSize.width - windowSize.width) / 2, (screenSize.height - windowSize.height) / 2);
setIconImage(new ImageIcon(MenuPrincipal.class.getResource("/packRecursos/icon.jpg")).getImage());
}
示例14: UIDefaultsEditor
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
public UIDefaultsEditor() {
renderer = new UIDefaultsRenderer();
renderer.addMouseListener(this);
popup = new JPopupMenu();
popup.setLayout(new BorderLayout());
JButton ok = new JButton(OK);
ok.addActionListener(this);
JButton cancel = new JButton(CANCEL);
cancel.addActionListener(this);
JPanel buttons = new JPanel(null);
GroupLayout layout = new GroupLayout(buttons);
buttons.setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER, true)
.addGroup(layout.createSequentialGroup()
.addGap(8).addComponent(ok).addGap(5).addComponent(cancel).addGap(8))
.addGap(100, 100, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createBaselineGroup(false, true)
.addComponent(ok).addComponent(cancel));
layout.linkSize(SwingUtilities.HORIZONTAL, ok, cancel);
popup.add(buttons, BorderLayout.SOUTH);
}
示例15: BooleanChooser
import javax.swing.GroupLayout.Alignment; //导入依赖的package包/类
@SuppressWarnings("unused")
BooleanChooser() {
tru = new JRadioButton(Boolean.TRUE.toString());
tru.setFont(UIDefaultsRenderer.BOOLEAN_FONT);
fal = new JRadioButton(Boolean.FALSE.toString());
fal.setFont(UIDefaultsRenderer.BOOLEAN_FONT);
ButtonGroup group = new ButtonGroup();
group.add(tru);
group.add(fal);
pane = new JPanel(null);
GroupLayout layout = new GroupLayout(pane);
pane.setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER, true)
.addGap(100, 100, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(8)
.addGroup(layout.createParallelGroup(Alignment.LEADING, false)
.addComponent(tru).addComponent(fal))
.addGap(8)));
layout.setVerticalGroup(layout.createSequentialGroup()
.addGap(2).addComponent(tru).addComponent(fal).addGap(4));
}