当前位置: 首页>>代码示例>>Java>>正文


Java BoxLayout.Y_AXIS属性代码示例

本文整理汇总了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);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:19,代码来源:QualifierAttributesSelectPanel.java

示例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);

}
 
开发者ID:mvetsch,项目名称:JWT4B,代码行数:17,代码来源:JLabelLink.java

示例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;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:17,代码来源:Toolbar.java

示例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);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:32,代码来源:NewRepositoryDialog.java

示例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;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:11,代码来源:ResultTab.java

示例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);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:41,代码来源:AboutDialogPanel.java

示例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))));
	}
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:33,代码来源:AboutDialogPanel.java

示例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);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:7,代码来源:DistributionsEditor.java

示例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);
  }
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:8,代码来源:PanelWidget.java

示例10: TextArea

public TextArea(){
	setBackground(Color.WHITE);
	BoxLayout layout = new BoxLayout(this,BoxLayout.Y_AXIS);
	setLayout(layout);
	
	clear();	
}
 
开发者ID:Emoun,项目名称:racp,代码行数:7,代码来源:TextArea.java

示例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();
}
 
开发者ID:ZencashOfficial,项目名称:zencash-swing-wallet-ui,代码行数:10,代码来源:AddressBookPanel.java

示例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();
}
 
开发者ID:ca333,项目名称:komodoGUI,代码行数:10,代码来源:AddressBookPanel.java

示例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
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:31,代码来源:FlagsEditorPanel.java

示例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;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:56,代码来源:BoxLayoutSupport.java

示例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;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:51,代码来源:SelectionDialog.java


注:本文中的javax.swing.BoxLayout.Y_AXIS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。