當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。