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


Java JLabel.setMinimumSize方法代码示例

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


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

示例1: createMtPanel

import javax.swing.JLabel; //导入方法依赖的package包/类
/**
 * Creates the {@link JPanel} showing the mission time.
 * 
 * @param maxwidth
 *            the dimension of the longest label
 * @return the JPanel showing the mission time
 */
private JPanel createMtPanel(Dimension maxwidth) {
	Double mtVal = inverse.evaluate(reliabilityFunction, standardMT);

	JLabel pmtLabel = new JLabel("P[MT] =");
	pmtLabel.setMinimumSize(maxwidth);

	JLabel mtLabel = new JLabel("MT:");
	mtLabel.setMinimumSize(maxwidth);

	mtProbability = new JFormattedTextField(mtFieldFormat);
	mtProbability.addActionListener(MeasurePanel.this);
	mtProbability.setPreferredSize(new Dimension(70, 15));
	mtProbability.setHorizontalAlignment(SwingConstants.RIGHT);
	mtProbability.setText(standardMT.toString());

	mt = new JLabel(mtVal.toString());

	return createSubPanel("Mission-Time", pmtLabel, mtProbability, mtLabel, mt);
}
 
开发者ID:felixreimann,项目名称:jreliability,代码行数:27,代码来源:MeasuresPanel.java

示例2: initGUI

import javax.swing.JLabel; //导入方法依赖的package包/类
/**
 * Initializes GUI.
 */
private void initGUI() {
    CalcLayout pane = new CalcLayout(5);
    JPanel p = new JPanel(pane);

    display = new JLabel("0", SwingConstants.RIGHT);
    display.setMinimumSize(new Dimension(75, 75));
    display.setVerticalAlignment(SwingConstants.BOTTOM);
    display.setBackground(Color.WHITE);
    display.setOpaque(false);
    display.setFont(new Font(display.getFont().toString(), Font.BOLD, 30));

    p.add(display, new RCPosition(1, 1));

    addNumberButtons(p);
    addOperatorButtons(p);
    addFunctionButtons(p);
    addControlButtons(p);
    getContentPane().add(p);
}
 
开发者ID:fgulan,项目名称:java-course,代码行数:23,代码来源:Calculator.java

示例3: init

import javax.swing.JLabel; //导入方法依赖的package包/类
private static void init(Container container) {
    container.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.BOTH;
    gbc.gridx = 0;
    gbc.gridy = 1;
    JLabel label = new JLabel();
    Dimension size = new Dimension(111, 0);
    label.setPreferredSize(size);
    label.setMinimumSize(size);
    container.add(label, gbc);
    gbc.gridx = 1;
    gbc.weightx = 1;
    container.add(new JScrollBar(JScrollBar.HORIZONTAL, 1, 111, 1, 1111), gbc);
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.weightx = 0;
    gbc.weighty = 1;
    container.add(new JScrollBar(JScrollBar.VERTICAL, 1, 111, 1, 1111), gbc);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:Test8039464.java

示例4: getErrorLabel

import javax.swing.JLabel; //导入方法依赖的package包/类
/** Returns the label displaying the current error in entered string (if any). */
private JLabel getErrorLabel() {
    if (this.errorLabel == null) {
        JLabel result = this.errorLabel = new JLabel();
        result.setForeground(Color.RED);
        result.setMinimumSize(getOkButton().getPreferredSize());
    }
    return this.errorLabel;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:10,代码来源:FormulaDialog.java

示例5: getErrorLabel

import javax.swing.JLabel; //导入方法依赖的package包/类
/** Returns the label displaying the current error in the renaming (if any). */
private JLabel getErrorLabel() {
    if (this.errorLabel == null) {
        JLabel result = this.errorLabel = new JLabel();
        result.setForeground(Color.RED);
        result.setMinimumSize(getReplaceButton().getPreferredSize());
    }
    return this.errorLabel;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:10,代码来源:FindReplaceDialog.java

示例6: getErrorLabel

import javax.swing.JLabel; //导入方法依赖的package包/类
private JLabel getErrorLabel() {
    if (this.errorLabel == null) {
        JLabel result = this.errorLabel = new JLabel();
        result.setForeground(Color.RED);
        result.setMinimumSize(getOkButton().getPreferredSize());
    }
    return this.errorLabel;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:9,代码来源:FreshNameDialog.java

示例7: getErrorLabel

import javax.swing.JLabel; //导入方法依赖的package包/类
/** Returns the label displaying the current error in entered string (if any). */
private JLabel getErrorLabel() {
    if (this.errorLabel == null) {
        JLabel result = this.errorLabel = new JLabel();
        result.setBorder(BorderFactory.createEmptyBorder(3, 0, 0, 0));
        result.setForeground(Color.RED);
        result.setPreferredSize(new Dimension(200, 25));
        result.setMinimumSize(getOkButton().getPreferredSize());
    }
    return this.errorLabel;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:12,代码来源:StringDialog.java

示例8: initGUI

import javax.swing.JLabel; //导入方法依赖的package包/类
/**
 * Initializes the GUI.
 */
private void initGUI() {
	realOuterPanel = new JPanel(new BorderLayout());

	outerLayer = new JLayer<JPanel>(realOuterPanel);
	savingGlassPane = new TransparentGlassPanePanel(WAITING_ICON,
			I18N.getGUILabel("configurable_dialog.saving_configurables"), getBackground(), 0.5f);
	outerLayer.setGlassPane(savingGlassPane);
	savingGlassPane.setVisible(false);

	JPanel pagePanel = new JPanel(new BorderLayout());

	// list of configurables
	JPanel configPanel = createConfigPanel();
	// force size so it does not resize itself depending on entered values
	configPanel.setMinimumSize(CONFIG_LIST_SIZE);
	configPanel.setMaximumSize(CONFIG_LIST_SIZE);
	configPanel.setPreferredSize(CONFIG_LIST_SIZE);
	buttonPanel = createConfigurableButtonPanel();
	// create middle spacer
	JLabel spacer = new JLabel();
	spacer.setMinimumSize(DIMENSION_SPACER_MIDDLE);
	spacer.setMaximumSize(DIMENSION_SPACER_MIDDLE);
	spacer.setPreferredSize(DIMENSION_SPACER_MIDDLE);
	// add both to an outer panel for layout reasons
	JPanel outerConfigPanel = new JPanel(new BorderLayout());
	outerConfigPanel.setBorder(BorderFactory.createMatteBorder(0, 1, 1, 1, Color.LIGHT_GRAY));
	outerConfigPanel.add(configPanel, BorderLayout.CENTER);
	outerConfigPanel.add(buttonPanel, BorderLayout.SOUTH);
	// another panel for layouting
	JPanel outermostConfigPanel = new JPanel(new BorderLayout());
	outermostConfigPanel.add(outerConfigPanel, BorderLayout.CENTER);
	outermostConfigPanel.add(spacer, BorderLayout.EAST);

	// glass pane showed if the user is not able to edit connections due to an old version of
	// the server
	simpleGlassPane = new TransparentGlassPanePanel(null, null, getBackground(), 0.5f);

	// panel displaying the selected configurable
	JPanel paramPanel = createParameterPanel();

	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.BOTH;
	c.weightx = 1;
	c.weighty = 0.3;
	c.gridwidth = GridBagConstraints.REMAINDER;

	// add panels to page panel
	pagePanel.add(outermostConfigPanel, BorderLayout.WEST);
	pagePanel.add(paramPanel, BorderLayout.CENTER);

	// add page and button panel to outer panel
	realOuterPanel.add(pagePanel, BorderLayout.CENTER);

	layoutDefault(outerLayer, makeSaveButton(), makeCancel());
	setDefaultSize(ButtonDialog.HUGE);
	setLocationRelativeTo(ApplicationFrame.getApplicationFrame());
	setModal(true);
	setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
	addWindowListener(new WindowAdapter() {

		@Override
		public void windowClosing(WindowEvent e) {
			cancelButton.doClick();
		}
	});

	updateButtonState(true);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:72,代码来源:ConfigurableDialog.java

示例9: initGUI

import javax.swing.JLabel; //导入方法依赖的package包/类
/**
 * Basic method to initialize the GUI.
 */
private void initGUI() {
	JPanel outerPanel = new JPanel();
	outerPanel.setLayout(new GridBagLayout());
	GridBagConstraints gbc = new GridBagConstraints();

	gbc.gridx = 0;
	gbc.gridy = 0;
	gbc.weightx = 1;
	gbc.fill = GridBagConstraints.BOTH;
	outerPanel.add(createStep1Panel(), gbc);

	if (oAuth.isOAuth2()) {
		gbc.gridy += 1;
		outerPanel.add(createStep2Panel(), gbc);
	}

	statusLabel = new JLabel();
	statusLabel.setMinimumSize(new Dimension(400, 25));
	statusLabel.setPreferredSize(new Dimension(400, 25));
	statusLabel.setHorizontalAlignment(JLabel.RIGHT);
	gbc.gridy += 1;
	gbc.insets = new Insets(5, 5, 5, 5);
	outerPanel.add(statusLabel, gbc);

	gbc.gridy += 1;
	Component btPanel = createButtons();
	outerPanel.add(btPanel, gbc);

	add(outerPanel);
	layoutDefault(outerPanel, confirmButton, cancelButton);
	if (oAuth.isOAuth2()) {
		setPreferredSize(new Dimension(375, 430));
	} else {
		setPreferredSize(new Dimension(375, 320));
	}
	setResizable(false);
	setModal(true);
	pack();
	setLocationRelativeTo(ApplicationFrame.getApplicationFrame());
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:44,代码来源:OAuthDialog.java

示例10: createMttfPanel

import javax.swing.JLabel; //导入方法依赖的package包/类
/**
 * Creates the {@link JPanel} showing the mean time to failure.
 * 
 * @param mttf
 *            the mean time to failure
 * @param maxWidth
 *            the dimension of the longest label
 * @return the JPanel showing the mean time to failure
 */
private JPanel createMttfPanel(Double mttf, Dimension maxWidth) {
	JLabel mttfLabel = new JLabel("MTTF:");
	mttfLabel.setMinimumSize(maxWidth);

	JLabel expectedValue = new JLabel(mttf.toString());

	return createSubPanel("Mean-Time-To-Failure", mttfLabel, expectedValue);
}
 
开发者ID:felixreimann,项目名称:jreliability,代码行数:18,代码来源:MeasuresPanel.java


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