本文整理汇总了Java中javax.swing.BoxLayout.Y_AXIS属性的典型用法代码示例。如果您正苦于以下问题:Java BoxLayout.Y_AXIS属性的具体用法?Java BoxLayout.Y_AXIS怎么用?Java BoxLayout.Y_AXIS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.swing.BoxLayout
的用法示例。
在下文中一共展示了BoxLayout.Y_AXIS属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: QualifierAttributesSelectPanel
public QualifierAttributesSelectPanel(Qualifier qualifier) {
super(new BorderLayout());
this.attributes = qualifier.getAttributes();
JPanel panel = new JPanel();
BoxLayout layout = new BoxLayout(panel, BoxLayout.Y_AXIS);
panel.setLayout(layout);
boxs = new JCheckBox[attributes.size()];
for (int i = 0; i < boxs.length; i++) {
boxs[i] = new JCheckBox(attributes.get(i).getName());
panel.add(boxs[i]);
}
JScrollPane pane = new JScrollPane(panel);
this.add(pane, BorderLayout.CENTER);
}
示例2: JLabelLink
public JLabelLink(String title, int x, int y) {
this.setTitle(title);
this.setSize(x,y);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.setBounds(0, 0, x,y);
this.setLocationRelativeTo(null);
this.setLocationRelativeTo(null);
pan = new JPanel();
pan.setBorder(new EmptyBorder(10, 10, 10, 10));
BoxLayout boxLayout = new BoxLayout(pan, BoxLayout.Y_AXIS);
pan.setLayout(boxLayout);
this.setContentPane(pan);
this.setVisible(true);
}
示例3: setOrientation
public void setOrientation(Object value) {
int axis;
String position;
if (value == HORIZONTAL) {
axis = BoxLayout.X_AXIS;
position = BorderLayout.LINE_START;
} else if (value == VERTICAL) {
axis = BoxLayout.Y_AXIS;
position = BorderLayout.NORTH;
} else {
throw new IllegalArgumentException();
}
this.remove(subpanel);
subpanel.setLayout(new BoxLayout(subpanel, axis));
this.add(subpanel, position);
this.orientation = value;
}
示例4: NewRepositoryDialog
private NewRepositoryDialog() {
super(RapidMinerGUI.getMainFrame(), "repositorydialog", true, new Object[] {});
Box firstPage = new Box(BoxLayout.Y_AXIS);
ButtonGroup checkBoxGroup = new ButtonGroup();
localButton = new JRadioButton(new ResourceActionAdapter("new_local_repositiory"));
localButton.setSelected(true);
checkBoxGroup.add(localButton);
firstPage.add(localButton);
Map<String, Component> cards = new HashMap<String, Component>();
cards.put("first", firstPage);
cards.put("local", localRepositoryPanel);
// register a radio button for each custom repository type
for (CustomRepositoryFactory factory : CustomRepositoryRegistry.INSTANCE.getFactories()) {
String key = factory.getI18NKey();
RepositoryConfigurationPanel repositoryConfigurationPanel = factory.getRepositoryConfigurationPanel();
JRadioButton radioButton = new JRadioButton(new ResourceActionAdapter(key));
radioButton.setEnabled(factory.enableRepositoryConfiguration());
repoConfigPanels.put(key, new Pair<>(repositoryConfigurationPanel, radioButton));
checkBoxGroup.add(radioButton);
firstPage.add(radioButton);
cards.put(factory.getI18NKey(), repositoryConfigurationPanel.getComponent());
}
firstPage.add(Box.createVerticalGlue());
layoutDefault(cards);
}
示例5: makeStandbyLabel
private static JComponent makeStandbyLabel() {
Box labelBox = new Box(BoxLayout.Y_AXIS);
labelBox.add(Box.createVerticalGlue());
Box horizontalBox = Box.createHorizontalBox();
horizontalBox.add(Box.createHorizontalGlue());
horizontalBox.add(new ResourceLabel("resulttab.creating_display"));
horizontalBox.add(Box.createHorizontalGlue());
labelBox.add(horizontalBox);
labelBox.add(Box.createVerticalGlue());
return labelBox;
}
示例6: initialize
/**
* Initialize the panel
*/
private void initialize() {
// Initialize dialog layout
JPanel panel = new JPanel(new BorderLayout(BORDERSIZE / 2, BORDERSIZE / 2));
panel.setBorder(BorderFactory.createEmptyBorder(BORDERSIZE, BORDERSIZE, BORDERSIZE, BORDERSIZE));
// Adds website image
JPanel tmpPanel = new JPanel(new BorderLayout(BORDERSIZE, BORDERSIZE));
// Adds polimi description
HtmlPanel titleLabel = new HtmlPanel();
titleLabel.setText(GraphStartScreen.HTML_CONTENT_TITLE_HREF);
titleLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
titleLabel.setAlignmentY(Component.CENTER_ALIGNMENT);
titleLabel.setOpaque(false);
tmpPanel.add(titleLabel, BorderLayout.CENTER);
// Adds application title
title = new JLabel();
title.setHorizontalTextPosition(SwingConstants.RIGHT);
title.setHorizontalAlignment(SwingConstants.CENTER);
title.setIconTextGap(BORDERSIZE);
tmpPanel.add(title, BorderLayout.SOUTH);
panel.add(tmpPanel, BorderLayout.NORTH);
// Adds text area
mainArea = new JPanel();
mainArea.setOpaque(false);
BoxLayout mainLayout = new BoxLayout(mainArea, BoxLayout.Y_AXIS);
mainArea.setLayout(mainLayout);
panel.add(mainArea, BorderLayout.CENTER);
JLabel legal = new JLabel(LEGAL);
panel.add(legal, BorderLayout.SOUTH);
panel.setPreferredSize(new Dimension(600,480));
JScrollPane scroll = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
this.add(scroll, BorderLayout.CENTER);
}
示例7: setNames
/**
* Add contributor names to current about window
* @param contributors contributors to be added
*/
public void setNames(Contributors... contributors) {
for (Contributors c : contributors) {
JPanel panel = new JPanel();
BoxLayout layout = new BoxLayout(panel, BoxLayout.Y_AXIS);
panel.setLayout(layout);
mainArea.add(panel);
panel.add(c.getCompany().getLogo());
StringBuilder sb = new StringBuilder(100);
sb.append("<html><p><font face='Arial' size='-1'><b>Major Contributors: </b>");
int idx=0;
for (String name: c.getProcessedNames()) {
if (idx++ > 0) {
sb.append(", ");
}
sb.append(name);
}
sb.append(".</font></p></html>");
JLabel label = new JLabel(sb.toString());
label.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
panel.add(label);
panel.setBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createEmptyBorder(5, 0, 5, 0),
BorderFactory.createCompoundBorder(
BorderFactory.createEtchedBorder(),
BorderFactory.createEmptyBorder(5, 5, 5, 5))));
}
}
示例8: BurstRenderer
public BurstRenderer() {
// added elements will be appended to the bottom row (vertically)
BoxLayout verticalBoxLayout = new BoxLayout(burstContentPanel,
BoxLayout.Y_AXIS);
burstContentPanel.setLayout(verticalBoxLayout);
scrolledPanel.add(burstContentPanel);
}
示例9: getLayout
private LayoutManager getLayout(Container c) {
if (fixed) {
return new GridLayout(0, nColumns);
}
else {
return new BoxLayout(c, vertical ? BoxLayout.Y_AXIS : BoxLayout.X_AXIS);
}
}
示例10: TextArea
public TextArea(){
setBackground(Color.WHITE);
BoxLayout layout = new BoxLayout(this,BoxLayout.Y_AXIS);
setLayout(layout);
clear();
}
示例11: AddressBookPanel
public AddressBookPanel(SendCashPanel sendCashPanel, JTabbedPane tabs) throws IOException {
this.sendCashPanel = sendCashPanel;
this.tabs = tabs;
BoxLayout boxLayout = new BoxLayout(this,BoxLayout.Y_AXIS);
setLayout(boxLayout);
add(buildTablePanel());
add(buildButtonsPanel());
loadEntriesFromDisk();
}
示例12: AddressBookPanel
public AddressBookPanel(SendCashPanel sendCashPanel, JTabbedPane tabs) throws IOException {
this.sendCashPanel = sendCashPanel;
this.tabs = tabs;
BoxLayout boxLayout = new BoxLayout(this,BoxLayout.Y_AXIS);
setLayout(boxLayout);
add(buildTablePanel());
add(buildButtonsPanel());
loadEntriesFromDisk();
}
示例13: FlagsEditorPanel
/** Creates a new instance of FlagsEditorPanel */
public FlagsEditorPanel(String flagString) {
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
listModel = new FlagListModel(flagString);
list = new JList(listModel);
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.addListSelectionListener(this);
add(new JScrollPane(list));
add(Box.createHorizontalStrut(3));
Box buttonBox = new Box(BoxLayout.Y_AXIS);
buttonBox.add(colorButton = new ColorChooserButton());
buttonBox.add(newButton = new JButton("New..."));
buttonBox.add(removeButton = new JButton("Remove"));
buttonBox.add(upButton = new JButton("Up"));
buttonBox.add(downButton = new JButton("Down"));
buttonBox.add(Box.createVerticalGlue());
add(buttonBox);
layoutButtonContainer(buttonBox);
colorButton.setColorChooserEnabled(false);
colorButton.addActionListener(this);
newButton.addActionListener(this);
removeButton.addActionListener(this);
upButton.addActionListener(this);
downButton.addActionListener(this);
selectionChanged(-1); // no selection
}
示例14: getProperties
/** Since BoxLayout is not a bean, we must specify its properties
* explicitly. This method is called from getPropertySets() implementation
* to obtain the default property set for the layout (assuming there's only
* one property set). So it woul be also possible to override (more
* generally) getPropertySets() instead.
* @return array of properties of the layout manager
*/
@Override
protected FormProperty[] getProperties() {
if (properties == null) {
// we cannot use RADProperty because "axis" is not a real
// bean property - we must create a special FormProperty
properties = new FormProperty[1];
properties[0] = new FormProperty(
PROP_AXIS,
Integer.TYPE,
getBundle().getString("PROP_axis"), // NOI18N
getBundle().getString("HINT_axis")) // NOI18N
{
@Override
public Object getTargetValue() {
return new Integer(axis);
}
@Override
public void setTargetValue(Object value) {
int ax = ((Integer)value).intValue();
if (ax == BoxLayout.X_AXIS || ax == BoxLayout.Y_AXIS
|| ax == BoxLayout.LINE_AXIS || ax == BoxLayout.PAGE_AXIS) {
axis = ax;
}
}
@Override
public boolean supportsDefaultValue() {
return true;
}
@Override
public Object getDefaultValue() {
return new Integer(BoxLayout.LINE_AXIS);
}
@Override
public PropertyEditor getExpliciteEditor() {
return new BoxAxisEditor();
}
};
// [!!]
// properties[0].setPropertyContext(
// new FormPropertyContext.DefaultImpl(getContainer().getFormModel()));
}
return properties;
}
示例15: constructJComponent
/** Constructs panel containing the main GUI components. */
private JPanel constructJComponent() {
// Selection panel
BoxLayout selectionPanelLayout = new BoxLayout(selectionPanel, BoxLayout.Y_AXIS);
selectionPanel.setLayout(selectionPanelLayout);
ButtonGroup radioButtons = new ButtonGroup();
if (optionsToSelect != null) {
for (int i = 0; i < optionsToSelect.size(); i++) {
JRadioButton radioButton = new JRadioButton(getI18n(optionsToSelect.get(i)));
radioButton.setHorizontalAlignment(JRadioButton.LEFT);
if (i == 0) {
radioButton.setSelected(true);
}
radioButtons.add(radioButton);
selectionPanel.add(radioButton);
}
}
// Checkbox panel
BoxLayout checkboxPanelLayout = new BoxLayout(checkboxPanel, BoxLayout.Y_AXIS);
checkboxPanel.setLayout(checkboxPanelLayout);
if (optionsToCheck != null) {
for (int i = 0; i < optionsToCheck.size(); i++) {
JCheckBox jCheckBox = new JCheckBox(getI18n(optionsToCheck.get(i)));
jCheckBox.setHorizontalAlignment(JCheckBox.LEFT);
checkboxPanel.add(jCheckBox);
}
}
// Overall panel
JPanel panel = new JPanel();
BoxLayout panelLayout = new BoxLayout(panel, BoxLayout.Y_AXIS);
panel.setLayout(panelLayout);
panel.add(selectionPanel);
if (optionsToSelect != null && !optionsToSelect.isEmpty() && optionsToCheck != null || !optionsToCheck.isEmpty()) {
panel.add(Box.createRigidArea(new Dimension(0, GAP_BETWEEN_SELECTIONS)));
}
panel.add(checkboxPanel);
JPanel leftMarginPanel = new JPanel();
BoxLayout leftMarginPanelLayout = new BoxLayout(leftMarginPanel, BoxLayout.X_AXIS);
leftMarginPanel.setLayout(leftMarginPanelLayout);
leftMarginPanel.add(Box.createRigidArea(new Dimension(getInfoIcon().getIconWidth() + BUTTON_DIALOG_LEFT_GAP, 0)));
leftMarginPanel.add(panel);
return leftMarginPanel;
}