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


Java FlowLayout.RIGHT属性代码示例

本文整理汇总了Java中java.awt.FlowLayout.RIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java FlowLayout.RIGHT属性的具体用法?Java FlowLayout.RIGHT怎么用?Java FlowLayout.RIGHT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.FlowLayout的用法示例。


在下文中一共展示了FlowLayout.RIGHT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AlignmentPropertyEditor

public AlignmentPropertyEditor() {
    super(
        new int[] {
            FlowLayout.CENTER,
            FlowLayout.LEFT,
            FlowLayout.RIGHT,
            FlowLayout.LEADING,
            FlowLayout.TRAILING
        },
        new String[] {
            "java.awt.FlowLayout.CENTER", // NOI18N
            "java.awt.FlowLayout.LEFT", // NOI18N
            "java.awt.FlowLayout.RIGHT", // NOI18N
            "java.awt.FlowLayout.LEADING", // NOI18N
            "java.awt.FlowLayout.TRAILING" // NOI18N
        },
        new String[] {
            "VALUE_AlignmentCenter", // NOI18N
            "VALUE_AlignmentLeft", // NOI18N
            "VALUE_AlignmentRight", // NOI18N
            "VALUE_AlignmentLeading", // NOI18N
            "VALUE_AlignmentTrailing" // NOI18N
        }
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:FlowLayoutBeanInfo.java

示例2: setup

private void setup(FilterModel<T> model)
{
	list = new FilterList<T>(model);

	okButton = new JButton("OK");
	cancelButton = new JButton("Cancel");

	okButton.addActionListener(this);
	cancelButton.addActionListener(this);

	JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	buttons.add(okButton);
	buttons.add(cancelButton);

	content = new JPanel(new BorderLayout(5, 5));
	content.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

	content.add(list, BorderLayout.CENTER);
	content.add(buttons, BorderLayout.SOUTH);
}
 
开发者ID:equella,项目名称:Equella,代码行数:20,代码来源:FilterDialog.java

示例3: makeButtonPanel

protected JPanel makeButtonPanel(AbstractButton... buttons) {
	JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, GAP, GAP));
	for (final AbstractButton button : buttons) {
		if (button != null) {
			buttonPanel.add(button);
			button.addActionListener(new ActionListener() {

				@Override
				public void actionPerformed(ActionEvent e) {
					ActionStatisticsCollector.getInstance().log(ActionStatisticsCollector.TYPE_DIALOG, key,
							button.getActionCommand());
				}
			});
		}
	}
	return buttonPanel;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:17,代码来源:ButtonDialog.java

示例4: setupGUI

/**
 * @return the error panel which can be extended to show the {@link #errorTable} if there are
 *         errors
 */
private void setupGUI() {
	errorScrollPane.setPreferredSize(new Dimension(errorScrollPane.getPreferredSize().width, MAXIMAL_HEIGHT));
	errorScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));

	collapsePane.add(errorScrollPane);
	collapsePane.setCollapsed(true);

	this.setLayout(new BorderLayout());
	this.add(collapsePane, BorderLayout.NORTH);

	JPanel errorContainerPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	errorContainerPanel.add(errorLabel);

	openErrorLabel.setText(SHOW_ERROR_TABLE);
	openErrorLabel.setForeground(SwingTools.RAPIDMINER_ORANGE);
	openErrorLabel.addMouseListener(new MouseAdapter() {

		@Override
		public void mousePressed(MouseEvent e) {
			errorPanelCollapsed = !errorPanelCollapsed;
			if (errorPanelCollapsed) {
				openErrorLabel.setText(SHOW_ERROR_TABLE);
			} else {
				openErrorLabel.setText(HIDE_ERROR_TABLE);
			}
			collapsePane.setCollapsed(errorPanelCollapsed);
		}
	});
	openErrorLabel.setVisible(false);

	errorContainerPanel.add(openErrorLabel);
	this.add(errorContainerPanel, BorderLayout.CENTER);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:37,代码来源:CollapsibleErrorTable.java

示例5: getButtonPanel

protected JPanel getButtonPanel() {
	if (this.buttonPanel == null) {
		this.buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
		this.buttonPanel.setOpaque(false);
		this.buttonPanel.setBorder(null);
	}
	return this.buttonPanel;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:8,代码来源:FileChooserUI.java

示例6: moveComponents

/**
 * Centers the elements in the specified row, if there is any slack.
 * @param target the component which needs to be moved
 * @param x the x coordinate
 * @param y the y coordinate
 * @param width the width dimensions
 * @param height the height dimensions
 * @param rowStart the beginning of the row
 * @param rowEnd the the ending of the row
 * @param ltr 
 * @param ruler 
 */
protected void moveComponents(Container target, int x, int y, int width,
		int height, int rowStart, int rowEnd, boolean ltr, Ruler ruler) {
	synchronized (target.getTreeLock()) {
		switch (getAlignment()) {
		case FlowLayout.LEFT:
			x += ltr ? 0 : width;
			break;
		case FlowLayout.CENTER:
			x += width / 2;
			break;
		case FlowLayout.RIGHT:
			x += ltr ? width : 0;
			break;
		case LEADING:
			break;
		case TRAILING:
			x += width;
			break;
		}
		int tabIndex = 0;
		for (int i = rowStart; i < rowEnd; i++) {
			Component m = target.getComponent(i);
			//          if (m.isVisible()) {
			if (hasConstraint(m, TAB_STOP))
				x = getInsets(target).left + ruler.getTab(tabIndex++);
			int dy = (valign == VTOP) ? 0 : (height - m.getHeight()) / 2;
			if (ltr) {
				m.setLocation(x, y + dy);
			} else {
				m.setLocation(target.getWidth() - x - m.getWidth(), y + dy);
			}
			x += m.getWidth() + hgap;
			//            }
		}
	}
}
 
开发者ID:CLARIN-PL,项目名称:WordnetLoom,代码行数:48,代码来源:RiverLayout.java

示例7: initComponents

/**
 * Set up the panel contents and layout
 */
private void initComponents() {
	classSpinner.addChangeListener(spinnerListener);
	help.addHelp(classSpinner, "Enter the number of classes for this system");

	classTable = new ClassTable();

	/* and now some Box black magic */
	//DEK (Federico Granata) 26-09-2003
	Box classSpinnerBox = Box.createHorizontalBox();
	//OLD
	//JLabel spinnerLabel = new JLabel("<html><font size=\"4\">Set the Number of classes (1-" + MAX_CLASSES + "):</font></html>");
	//NEW
	//@author Stefano
	JLabel spinnerLabel = new JLabel(DESCRIPTION_CLASSES);

	classSpinnerBox.add(spinnerLabel);
	//END
	//BEGIN Federico Dall'Orso 9/3/2005
	//OLD
	/*
	classSpinnerBox.add(Box.createGlue());
	*/
	//NEW
	classSpinnerBox.add(Box.createHorizontalStrut(10));
	Box numberBox = Box.createVerticalBox();

	JPanel spinnerPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	JLabel numberLabel = new JLabel("Number:");
	classSpinner.setMaximumSize(new Dimension(600, 18));
	spinnerPanel.add(numberLabel);
	spinnerPanel.add(classSpinner);
	numberBox.add(spinnerPanel);

	numberBox.add(new JButton(addClass));

	numberBox.setMaximumSize(new Dimension(150, 50));

	classSpinnerBox.add(numberBox);
	//END  Federico Dall'Orso 9/3/2005

	Box classBox = Box.createVerticalBox();
	classBox.add(Box.createVerticalStrut(20));
	classBox.add(classSpinnerBox);
	classBox.add(Box.createVerticalStrut(10));
	JScrollPane classTablePane = new JScrollPane(classTable);
	classTablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	classTablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	classBox.add(classTablePane);
	classBox.add(Box.createVerticalStrut(20));

	Box totalBox = Box.createHorizontalBox();
	totalBox.add(Box.createHorizontalStrut(20));
	totalBox.add(classBox);
	totalBox.add(Box.createHorizontalStrut(20));

	setLayout(new BorderLayout());
	add(totalBox, BorderLayout.CENTER);

}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:62,代码来源:ClassesPanel.java

示例8: getConfigPanel

/** Returns the panel with the name field, main panel, syntax help, close buttons and error field. */
private JPanel getConfigPanel() {
    if (this.configPanel == null) {
        // configuration name
        JPanel namePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        namePanel.add(new JLabel("Name:"));
        namePanel.add(getNameField());
        // error panel
        JPanel errorPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        errorPanel.add(getErrorLabel());
        // action buttons
        JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        buttonPanel.add(new JButton(getApplyAction()));
        buttonPanel.add(new JButton(getRevertAction()));
        buttonPanel.add(new JButton(getStartAction()));
        buttonPanel.add(new JButton(getCloseAction()));

        JComponent mainPanel = createMainPanel();

        JPanel bottomPanel = new JPanel();
        bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.Y_AXIS));
        bottomPanel.add(errorPanel);
        bottomPanel.add(buttonPanel);

        this.configPanel = new JPanel(new BorderLayout(3, 3));
        this.configPanel.setBorder(createBorder());
        this.configPanel.add(namePanel, BorderLayout.NORTH);
        this.configPanel.add(mainPanel, BorderLayout.CENTER);
        this.configPanel.add(bottomPanel, BorderLayout.SOUTH);
    }
    return this.configPanel;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:32,代码来源:ConfigDialog.java

示例9: createButtonsPanel

private void createButtonsPanel() {
    buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    saveButton = new JButton("Save");
    cancelButton = new JButton("Cancel");

    buttonsPanel.add(cancelButton);
    buttonsPanel.add(saveButton);

    add(buttonsPanel, BorderLayout.SOUTH);
}
 
开发者ID:nebbian,项目名称:RoboxSlicerExtension,代码行数:10,代码来源:ControlWindow.java

示例10: getButtonPanel

private JPanel getButtonPanel() {
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT));

    panel.add(getOkButton());
    panel.add(getCancelButton());

    return panel;
}
 
开发者ID:Zephyr-Koo,项目名称:java-gui-practical-demo,代码行数:8,代码来源:P3Q5.java

示例11: setup

private void setup()
{
	left = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
	right = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));

	clearMessageTimer = new Timer();

	spinner = new JImage(image);
	spinner.setIcon(null);

	message = new JLabel();
	message.setBorder(BorderFactory.createEmptyBorder(0, 5, 2, 5));
	message.setOpaque(true);
	message.setForeground(Color.DARK_GRAY);
	clearMessage(LEVEL_GOD_LIKE);

	setBorder(new LineBorder(Color.GRAY, 1, 0, 0, 0));
	setOpaque(true);

	final int[] rows = new int[]{image.getIconHeight()};
	final int[] cols = new int[]{TableLayout.FILL, TableLayout.FILL};
	TableLayout layout = new TableLayout(rows, cols);

	setLayout(layout);

	add(left, new Rectangle(0, 0, 1, 1));
	add(right, new Rectangle(1, 0, 1, 1));

	resetSpinner();
	resetMessage();
}
 
开发者ID:equella,项目名称:Equella,代码行数:31,代码来源:JStatusBar.java

示例12: AbstractConfigurationWizard

/** Creates a new wizard. */
public AbstractConfigurationWizard(String name, ConfigurationListener listener) {
	super(RapidMinerGUI.getMainFrame(), name, true);

	this.listener = listener;

	// button panel
	JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	buttonPanel.add(previous);
	buttonPanel.add(next);

	buttonPanel.add(Box.createHorizontalStrut(11));
	JButton cancel = new JButton(new ResourceAction("cancel") {

		private static final long serialVersionUID = 1L;

		@Override
		public void actionPerformed(ActionEvent e) {
			cancel();
		}
	});
	buttonPanel.add(cancel);

	getContentPane().add(buttonPanel, BorderLayout.SOUTH);

	// main panel
	c.fill = GridBagConstraints.BOTH;
	c.anchor = GridBagConstraints.NORTHWEST;
	c.weightx = 1;
	c.weighty = 1;
	c.gridwidth = GridBagConstraints.REMAINDER;
	c.insets = new Insets(11, 11, 11, 11);
	this.contentPanel = new JPanel(layout);
	layout.setConstraints(mainPanel, c);
	contentPanel.add(mainPanel);

	getContentPane().add(contentPanel, BorderLayout.CENTER);

	setSize(Math.max(640, (int) (0.66d * getOwner().getWidth())), Math.max(480, (int) (0.66d * getOwner().getHeight())));

	setLocationRelativeTo(getOwner());
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:42,代码来源:AbstractConfigurationWizard.java

示例13: loadOperations

public void loadOperations(XMBean mbean, MBeanInfo mbeanInfo) {
    this.mbean = mbean;
    this.mbeanInfo = mbeanInfo;
    // add operations information
    MBeanOperationInfo operations[] = mbeanInfo.getOperations();
    invalidate();

    // remove listeners, if any
    Component listeners[] = getComponents();
    for (int i = 0; i < listeners.length; i++) {
        if (listeners[i] instanceof JButton) {
            ((JButton) listeners[i]).removeActionListener(this);
        }
    }

    removeAll();
    setLayout(new BorderLayout());

    JButton methodButton;
    JLabel methodLabel;
    JPanel innerPanelLeft, innerPanelRight;
    JPanel outerPanelLeft, outerPanelRight;
    outerPanelLeft = new JPanel(new GridLayout(operations.length, 1));
    outerPanelRight = new JPanel(new GridLayout(operations.length, 1));

    for (int i = 0; i < operations.length; i++) {
        innerPanelLeft = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        innerPanelRight = new JPanel(new FlowLayout(FlowLayout.LEFT));
        String returnType = operations[i].getReturnType();
        if (returnType == null) {
            methodLabel = new JLabel("null", JLabel.RIGHT);
            if (JConsole.isDebug()) {
                System.err.println(
                        "WARNING: The operation's return type " +
                        "shouldn't be \"null\". Check how the " +
                        "MBeanOperationInfo for the \"" +
                        operations[i].getName() + "\" operation has " +
                        "been defined in the MBean's implementation code.");
            }
        } else {
            methodLabel = new JLabel(
                    Utils.getReadableClassName(returnType), JLabel.RIGHT);
        }
        innerPanelLeft.add(methodLabel);
        if (methodLabel.getText().length() > 20) {
            methodLabel.setText(methodLabel.getText().
                    substring(methodLabel.getText().
                    lastIndexOf(".") + 1,
                    methodLabel.getText().length()));
        }

        methodButton = new JButton(operations[i].getName());
        methodButton.setToolTipText(operations[i].getDescription());
        boolean callable = isCallable(operations[i].getSignature());
        if (callable) {
            methodButton.addActionListener(this);
        } else {
            methodButton.setEnabled(false);
        }

        MBeanParameterInfo[] signature = operations[i].getSignature();
        OperationEntry paramEntry = new OperationEntry(operations[i],
                callable,
                methodButton,
                this);
        operationEntryTable.put(methodButton, paramEntry);
        innerPanelRight.add(methodButton);
        if (signature.length == 0) {
            innerPanelRight.add(new JLabel("( )", JLabel.CENTER));
        } else {
            innerPanelRight.add(paramEntry);
        }

        outerPanelLeft.add(innerPanelLeft, BorderLayout.WEST);
        outerPanelRight.add(innerPanelRight, BorderLayout.CENTER);
    }
    add(outerPanelLeft, BorderLayout.WEST);
    add(outerPanelRight, BorderLayout.CENTER);
    validate();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:80,代码来源:XOperations.java

示例14: TableEditor

public TableEditor(TablesManagerWindow aTablesManager, Table aTable, TableEditorMode aMode) {
	table = aTable;
	tablesManagerParent = aTablesManager;
	mode = aMode;
	schemaHasChanged = false;
	
	mainContainer = new JPanel();
	centerPanel = new JPanel();
	attrListPanel = new JPanel();
	attrEditorPanel = new JPanel();
	
	tableName = new JTextField();
	newAttrName = new JTextField();
	newAttrType = new JComboBox<DataType>(DataType.values());
	attrList = new JList<Attribute>();
	defaultListModel = new DefaultListModel<Attribute>();
	attrList.setModel(defaultListModel);
	attrList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	
	tableOriginalName = aTable.getName();
	
	newAttrName.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT));
	newAttrType.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT));
	
	addAttrButton = new JButton("ADD");
	eraseAttrButton = new JButton("ERASE");
	okButton = new JButton("OK");
	
	setLayout(new BorderLayout());
	
	JPanel tableNamePanel = new JPanel(new BorderLayout());
	tableNamePanel.add(new JLabel("Table name: "), BorderLayout.WEST);
	tableNamePanel.add(tableName, BorderLayout.CENTER);
	
	buildAttrListPanel();
	buildAttrEditorPanel();
	
	centerPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
	centerPanel.add(attrListPanel, BorderLayout.WEST);
	centerPanel.add(new JLabel(" << "), BorderLayout.CENTER);
	centerPanel.add(attrEditorPanel, BorderLayout.EAST);
	
	mainContainer.setLayout(new BorderLayout());
	mainContainer.add(tableNamePanel, BorderLayout.NORTH);
	mainContainer.add(centerPanel, BorderLayout.CENTER);
	addPaddingToMainContainer();
	add(mainContainer, BorderLayout.CENTER);
	
	JPanel okButtonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	okButtonPanel.add(okButton);
	mainContainer.add(okButtonPanel, BorderLayout.SOUTH);
	
	// Add some padding
	centerPanel.setBorder(new EmptyBorder(CENTER_TOP_PADDING,
			CENTER_LEFT_PADDING, CENTER_BOTTOM_PADDING, CENTER_RIGHT_PADDING));
	
	buildOkButton();
	buildWindow();
	setCreationModeConfiguration();
	setModificationModeConfiguration();
	
	pack();
}
 
开发者ID:tteguayco,项目名称:JITRAX,代码行数:63,代码来源:TableEditor.java

示例15: DBMSConnectionWindow

public DBMSConnectionWindow(JFrame owner) {
	super(owner);
	
	dbmsList = new JComboBox<String>(DBMS_LIST);
	hostname = new JTextField();
	port = new JTextField();
	username = new JTextField();
	password = new JPasswordField();
	nextButton = new JButton("✔ Next");
	
	hostname.setText(DEFAULT_HOSTNAME);
	port.setText(DEFAULT_PORT);
	username.setText(DEFAULT_USERNAME);
	password.setText(DEFAULT_PASSWORD);
	
	dbmsList.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT));
	hostname.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT));
	port.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT));
	username.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT));
	password.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT));
	
	JPanel mainContainer = new JPanel();
	mainContainer.setLayout(new BoxLayout(mainContainer, BoxLayout.Y_AXIS));
	mainContainer.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
	
	JPanel dbmsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	dbmsPanel.add(new JLabel("DBMS: "));
	dbmsPanel.add(dbmsList);
	
	JPanel hostnamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	hostnamePanel.add(new JLabel("Hostname: "));
	hostnamePanel.add(hostname);
	
	JPanel portPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	portPanel.add(new JLabel("Port: "));
	portPanel.add(port);
	
	JPanel usernamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	usernamePanel.add(new JLabel("Username: "));
	usernamePanel.add(username);
	
	JPanel passwordPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	passwordPanel.add(new JLabel("Password: "));
	passwordPanel.add(password);
	
	JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
	buttonsPanel.add(nextButton);
	
	mainContainer.add(dbmsPanel);
	mainContainer.add(hostnamePanel);
	mainContainer.add(portPanel);
	mainContainer.add(usernamePanel);
	mainContainer.add(passwordPanel);
	mainContainer.add(buttonsPanel);
	add(mainContainer);
	
	buildWindow();
	pack();
}
 
开发者ID:tteguayco,项目名称:JITRAX,代码行数:59,代码来源:DBMSConnectionWindow.java


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