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


Java JPanel.setAlignmentX方法代码示例

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


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

示例1: create2ColPane

import javax.swing.JPanel; //导入方法依赖的package包/类
/**
 * Like createPane, but creates a pane with 2 columns of radio buttons. The
 * number of buttons passed in *must* be even.
 */
private JPanel create2ColPane(String description, JRadioButton[] radioButtons, JButton showButton) {
    JLabel label = new JLabel(description);
    int numPerColumn = radioButtons.length / 2;

    JPanel grid = new JPanel(new GridLayout(0, 2));
    for (int i = 0; i < numPerColumn; i++) {
        grid.add(radioButtons[i]);
        grid.add(radioButtons[i + numPerColumn]);
    }

    JPanel box = new JPanel();
    box.setLayout(new BoxLayout(box, BoxLayout.PAGE_AXIS));
    box.add(label);
    grid.setAlignmentX(0.0f);
    box.add(grid);

    JPanel pane = new JPanel(new BorderLayout());
    pane.add(box, BorderLayout.PAGE_START);
    pane.add(showButton, BorderLayout.PAGE_END);

    return pane;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:27,代码来源:DialogDemo.java

示例2: initComponents

import javax.swing.JPanel; //导入方法依赖的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.
 */
private void initComponents() {
	setToolTipText("Select a tab to configure an aspect of the device.");

	onchipBiasgenPanel = new JPanel();
	onchipBiasgenPanel.setLayout(new BoxLayout(onchipBiasgenPanel, BoxLayout.Y_AXIS));
	onchipBiasgenPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
	addTab("On-chip biases (biasgen)", (onchipBiasgenPanel));

	offchipDACPanel = new JPanel();
	offchipDACPanel.setLayout(new BoxLayout(offchipDACPanel, BoxLayout.Y_AXIS));
	addTab("Off-chip biases (DAC)", (offchipDACPanel));

	aerPanel = new JPanel();
	aerPanel.setLayout(new BoxLayout(aerPanel, BoxLayout.Y_AXIS));
	addTab("AER Config", (aerPanel));

	chipDiagPanel = new JPanel();
	chipDiagPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
	chipDiagPanel.setLayout(new BoxLayout(chipDiagPanel, BoxLayout.Y_AXIS));
	addTab("Chip Diag Config", (chipDiagPanel));

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:28,代码来源:SampleProbControlPanel.java

示例3: buildSeparator

import javax.swing.JPanel; //导入方法依赖的package包/类
/**
 * Builds a separator for the node parâmetros
 *
 * @return JComponent
 */
private JComponent buildSeparator() {
    JSeparator separator = new JSeparator(JSeparator.HORIZONTAL);
    separator.setBorder(new EmptyBorder(0, 0, 0, 25));
    separator.setForeground(new Color(0xAAAAAA));
    separator.setBackground(new Color(0xAAAAAA));
    JPanel container = new JPanel(new BorderLayout());
    container.setBorder(new EmptyBorder(0, 10, 0, 10));
    container.add(separator);
    container.setAlignmentX(JLabel.LEFT_ALIGNMENT);
    container.setOpaque(false);
    return container;
}
 
开发者ID:VISNode,项目名称:VISNode,代码行数:18,代码来源:NodeView.java

示例4: buildLabel

import javax.swing.JPanel; //导入方法依赖的package包/类
/**
 * Build the label for the parameter
 *
 * @param text
 * @return JComponent
 */
private JComponent buildLabel(String text) {
    JLabel label = new JLabel(text, JLabel.LEFT);
    label.setBorder(new EmptyBorder(0, 15, 0, 0));
    label.setFont(new Font("Segoe UI", Font.PLAIN, 9));
    JPanel container = new JPanel(new BorderLayout(5, 0));
    container.add(label, BorderLayout.WEST);
    container.setAlignmentX(JLabel.LEFT_ALIGNMENT);
    container.setOpaque(false);
    return container;
}
 
开发者ID:VISNode,项目名称:VISNode,代码行数:17,代码来源:NodeView.java

示例5: createVerticalPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
public JPanel createVerticalPanel(boolean threeD) 
{
	JPanel p = new JPanel();
	p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
	p.setAlignmentY(TOP_ALIGNMENT);
	p.setAlignmentX(LEFT_ALIGNMENT);
	if(threeD) 
	{
		p.setBorder(loweredBorder);
	}
	return p;
}
 
开发者ID:HML-UnBBayes,项目名称:hml,代码行数:13,代码来源:MyPanel.java

示例6: VizCustomizationPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
/** Constructs a customization panel.
 * @param divider - the JSplitPane separating the left-customization-half with the right-graph-half
 * @param vizState - the VizState object that will be customized by this customization panel
 */
public VizCustomizationPanel(JSplitPane divider, VizState vizState) {
   this.divider = divider;
   this.vizState = vizState;
   setBorder(null);
   setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
   zoomPane = new JPanel();
   zoomPane.setBorder(new OurBorder(false,false,true,false));
   zoomPane.setLayout(new BoxLayout(zoomPane, BoxLayout.Y_AXIS));
   zoomPane.setAlignmentX(0f);
   zoomPane.setBackground(wcolor);
   remakeAll();
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:17,代码来源:VizCustomizationPanel.java

示例7: VizCustomizationPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
/**
 * Constructs a customization panel.
 * 
 * @param divider - the JSplitPane separating the left-customization-half
 *            with the right-graph-half
 * @param vizState - the VizState object that will be customized by this
 *            customization panel
 */
public VizCustomizationPanel(JSplitPane divider, VizState vizState) {
	this.divider = divider;
	this.vizState = vizState;
	setBorder(null);
	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
	zoomPane = new JPanel();
	zoomPane.setBorder(new OurBorder(false, false, true, false));
	zoomPane.setLayout(new BoxLayout(zoomPane, BoxLayout.Y_AXIS));
	zoomPane.setAlignmentX(0f);
	zoomPane.setBackground(wcolor);
	remakeAll();
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:21,代码来源:VizCustomizationPanel.java

示例8: generateControl

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
public JComponent generateControl()
{
	field = new JTextField();
	field.setMaximumSize(new Dimension(Short.MAX_VALUE, 20));

	if( items.size() >= 1 )
	{
		field.setText(((Item) items.get(0)).getValue());
	}

	JButton browse = new JButton("Browse");
	browse.setIcon(new ImageIcon(getClass().getResource("/images/browse.gif")));
	browse.setHorizontalTextPosition(SwingConstants.RIGHT);
	Dimension browseSize = browse.getPreferredSize();
	browseSize.height = 20;
	browse.setMaximumSize(browseSize);
	browse.addActionListener(this);

	JPanel group = new JPanel();
	group.setLayout(new BoxLayout(group, BoxLayout.X_AXIS));
	group.add(field);
	group.add(Box.createRigidArea(new Dimension(5, 0)));
	group.add(browse);
	group.setAlignmentX(Component.LEFT_ALIGNMENT);

	return group;
}
 
开发者ID:equella,项目名称:Equella,代码行数:29,代码来源:GResourceSelector.java

示例9: setup

import javax.swing.JPanel; //导入方法依赖的package包/类
private void setup()
{
	editor = new JPanel(new BorderLayout(5, 0));
	editor.setAlignmentX(Component.LEFT_ALIGNMENT);
	editor.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),
		BorderFactory.createEmptyBorder(2, 5, 2, 5)));

	editor.add(createButtons(), BorderLayout.EAST);
	editor.add(createCentre(), BorderLayout.CENTER);
}
 
开发者ID:equella,项目名称:Equella,代码行数:11,代码来源:WhereModel.java

示例10: setup

import javax.swing.JPanel; //导入方法依赖的package包/类
protected void setup()
{
	editor = new JPanel(new BorderLayout(5, 0));
	editor.setAlignmentX(Component.LEFT_ALIGNMENT);
	editor.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),
		BorderFactory.createEmptyBorder(2, 5, 2, 5)));

	editor.add(createButtons(), BorderLayout.EAST);
	editor.add(createCentre(), BorderLayout.CENTER);
}
 
开发者ID:equella,项目名称:Equella,代码行数:11,代码来源:AbstractBasicModel.java

示例11: setup

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
protected void setup()
{
	editor = new JPanel(new BorderLayout(5, 0));
	editor.setAlignmentX(Component.LEFT_ALIGNMENT);
	editor.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),
		BorderFactory.createEmptyBorder(2, 5, 2, 5)));

	editor.add(createTop(), BorderLayout.NORTH);
	editor.add(createButtons(), BorderLayout.EAST);
	editor.add(createCentre(), BorderLayout.CENTER);
}
 
开发者ID:equella,项目名称:Equella,代码行数:13,代码来源:WorkflowModel.java

示例12: createHorizontalPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
public JPanel createHorizontalPanel(boolean threeD) 
{
	JPanel p = new JPanel();
	p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
	p.setAlignmentY(TOP_ALIGNMENT);
	p.setAlignmentX(LEFT_ALIGNMENT);
	if(threeD) 
	{
		p.setBorder(loweredBorder);
	}
	return p;
}
 
开发者ID:HML-UnBBayes,项目名称:hml,代码行数:13,代码来源:MyPanel.java

示例13: initComponents

import javax.swing.JPanel; //导入方法依赖的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.
 */
private void initComponents() {

	onchipBiasgenPanel = new JPanel();
	onchipBiasgenPanel.setLayout(new BoxLayout(onchipBiasgenPanel, BoxLayout.Y_AXIS));
	onchipBiasgenPanel.setAlignmentX(LEFT_ALIGNMENT);
	addTab("On-chip biases (biasgen)", (onchipBiasgenPanel));

	offchipDACPanel = new JPanel();
	offchipDACPanel.setLayout(new BoxLayout(offchipDACPanel, BoxLayout.Y_AXIS));
	addTab("Off-chip biases (DAC)", (offchipDACPanel));

	channelPanel = new JPanel();
	channelPanel.setLayout(new BoxLayout(channelPanel, BoxLayout.Y_AXIS));
	addTab("Channels", (channelPanel));

	scannerPanel = new JPanel();
	scannerPanel.setLayout(new BoxLayout(scannerPanel, BoxLayout.Y_AXIS));
	addTab("Scanner Config", (scannerPanel));

	aerPanel = new JPanel();
	aerPanel.setLayout(new BoxLayout(aerPanel, BoxLayout.Y_AXIS));
	addTab("AER Config", (aerPanel));

	adcPanel = new JPanel();
	adcPanel.setLayout(new BoxLayout(adcPanel, BoxLayout.Y_AXIS));
	addTab("ADC", (adcPanel));

	chipDiagPanel = new JPanel();
	chipDiagPanel.setAlignmentX(LEFT_ALIGNMENT);
	chipDiagPanel.setLayout(new BoxLayout(chipDiagPanel, BoxLayout.Y_AXIS));
	addTab("Chip Diag Config", (chipDiagPanel));
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:38,代码来源:CochleaLPControlPanel.java

示例14: makeGUIControl

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
public JComponent makeGUIControl() {

	final JPanel pan = new JPanel();
	pan.setAlignmentX(Component.LEFT_ALIGNMENT);
	pan.setLayout(new BoxLayout(pan, BoxLayout.X_AXIS));

	final JLabel label = new JLabel(getName());
	label.setToolTipText(
		"<html>" + toString() + "<br>" + getDescription() + "<br>Enter value or use mouse wheel or arrow keys to change value.");
	pan.add(label);

	final JTextField tf = new JTextField();
	tf.setText(Integer.toString(get()));
	tf.setPreferredSize(prefDimensions);
	tf.setMaximumSize(maxDimensions);
	SPIConfigIntActions actionListeners = new SPIConfigIntActions(this);
	tf.addActionListener(actionListeners);
	tf.addFocusListener(actionListeners);
	tf.addKeyListener(actionListeners);
	tf.addMouseWheelListener(actionListeners);
	pan.add(tf);
	setControl(tf);
	addObserver(biasgen);	// This observer is responsible for sending data to hardware
	addObserver(this);		// This observer is responsible for GUI update. It calls the updateControl() method
	return pan;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:28,代码来源:SPIConfigInt.java

示例15: buildPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
/** builds the panel of pots */
    private void buildPanel() {
        IPotSliderTextControl.allInstances.clear();
        potList=new ArrayList<Pot>(pots.getPots());
        componentList=new ArrayList<JComponent>();
        Collections.sort(potList, new PotDisplayComparator());
        potsPanel=new JPanel();
        potsPanel.setAlignmentX(RIGHT_ALIGNMENT);
        potsPanel.getInsets().set(0, 0, 0, 0);
        potsPanel.setLayout(new BoxLayout(potsPanel, BoxLayout.Y_AXIS));
        scrollPane=new JScrollPane(potsPanel);
        add(new PotSorter(componentList, potList));
        add(scrollPane);
        for(Pot p : potList) {
            JComponent s=p.makeGUIPotControl(); // make a bias control gui component
            s.setAlignmentX(RIGHT_ALIGNMENT);
            potsPanel.add(s);
            componentList.add(s);
            addBorderSetter(s);
        }
        potsPanel.add(Box.createVerticalGlue());
//        JPanel fillPanel=new JPanel();
//        fillPanel.setMinimumSize(new Dimension(0, 0));
//        fillPanel.setPreferredSize(new Dimension(0, 0));
//        fillPanel.setMaximumSize(new Dimension(32767, 32767));
//        potsPanel.add(fillPanel); // spacer at bottom so biases don't stretch out too much
    }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:28,代码来源:PotPanel.java


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