當前位置: 首頁>>代碼示例>>Java>>正文


Java JTextField.setVisible方法代碼示例

本文整理匯總了Java中javax.swing.JTextField.setVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java JTextField.setVisible方法的具體用法?Java JTextField.setVisible怎麽用?Java JTextField.setVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JTextField的用法示例。


在下文中一共展示了JTextField.setVisible方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doComboBoxAction

import javax.swing.JTextField; //導入方法依賴的package包/類
@Override
protected void doComboBoxAction() {
	if (comboBox.getSelectedIndex() > 0) {
		// get the params of the selected resource type.
		paramNames = new ArrayList<String>();
		paramValues = new ArrayList<JTextField>();
		for (final Method m : ((ComboBoxClass) comboBox.getSelectedItem())
				.getClasss().getDeclaredMethods()) {
			// for every setter method get the name of the parameter to set
			// and display it as a label along with a text field for setting
			// the value.
			if (m.isAnnotationPresent(ExchangeParameter.class)
					&& m.getName().startsWith("set")) {
				String name = m.getName().substring(3).toLowerCase();
				paramNames.add(name);
				JLabel paramName = new JLabel(name.replaceFirst("demanded",
						"demanded "));
				paramName.setVisible(true);
				paramsPanel.add(paramName);
				JTextField paramValue = new JTextField(3);
				paramValue.setEditable(true);
				paramValue.setVisible(true);
				paramValues.add(paramValue);
				paramsPanel.add(paramValue);
				paramValue.requestFocus();
			}
		}
	}
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:30,代碼來源:AddConstraintDialog.java

示例2: initPanel2

import javax.swing.JTextField; //導入方法依賴的package包/類
private void initPanel2(){
    panel2 = new JPanel();
    panel2.setLayout(new GridLayout(2,1));
    
    testo = new JTextField();
    testo.setVisible(true);
    testo.setEditable(false);
    int soldi = parcheggio.getCassa().getAmmount();
    if (soldi==0) {
        testo.setText("Non ci sono soldi nella cassa.");
    }
    else {
        testo.setText("Ci sono "+soldi+"Euro nella cassa");
    }
    
    JButton bottone = new JButton("Ritira denaro");
    bottone.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed(ActionEvent e) {
            int tmp = parcheggio.getCassa().ritira();
            if (tmp==0) {
                testo.setText("Non ci sono soldi nella cassa");
            }
            else {
                testo.setText("Sono stati ritirati "+tmp+"Euro");
            }
        }
    });
    panel2.add(bottone);
    panel2.add(testo);
    this.add(panel2,BorderLayout.NORTH);
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-E,代碼行數:33,代碼來源:GUIOperatore.java

示例3: setType

import javax.swing.JTextField; //導入方法依賴的package包/類
private void setType() {
    int locationPoint = 323;
    for (int i = 0; i < 3; i++) {

        roomTypes = new JTextField();
        roomTypes.setColumns(10);
        roomTypes.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
        roomTypes.setBounds(locationPoint, 97, 86, 20);
        roomTypes.setVisible(false);
        bottomPanel.add(roomTypes);

        roomTypeFields[i] = roomTypes;
        locationPoint = locationPoint + 96;
    }
}
 
開發者ID:Coder-ACJHP,項目名稱:Hotel-Properties-Management-System,代碼行數:16,代碼來源:HotelPropertiesWindow.java

示例4: doComboBoxAction

import javax.swing.JTextField; //導入方法依賴的package包/類
@Override
protected void doComboBoxAction() {
	if (comboBox.getSelectedIndex() > 0) {
		// get params of the selected resource type
		paramNames = new ArrayList<String>();
		paramValues = new ArrayList<JTextField>();
		AbstractConstraint selectedCons = ((ComboBoxConstraint) comboBox
				.getSelectedItem()).getConstraint();
		for (final Method m : selectedCons.getClass().getDeclaredMethods()) {
			if (m.isAnnotationPresent(ExchangeParameter.class)
					&& m.getName().startsWith("set")) {
				// For every setter method get the name of the parameter to
				// set and display it as a label along with a text field for
				// setting the value.
				String name = m.getName().substring(3).toLowerCase();
				paramNames.add(name);
				JLabel paramName = new JLabel(name.replaceFirst("demanded",
						"demanded "));
				paramName.setVisible(true);
				paramsPanel.add(paramName);
				JTextField paramValue = new JTextField(3);
				try {
					paramValue
							.setText(selectedCons
									.getClass()
									.getMethod(
											"get"
													+ m.getName()
															.substring(3),
											new Class<?>[0])
									.invoke(selectedCons, new Object[0])
									.toString());
				} catch (Exception e) {
					e.printStackTrace();
					throw new AssertionError(
							"Error occurred while trying to access a get Metdod of the Object "
									+ entity);
				}
				paramValue.setEditable(true);
				paramValue.setVisible(true);
				paramValues.add(paramValue);
				paramsPanel.add(paramValue);
				paramValue.requestFocus();
			}
		}
	}
}
 
開發者ID:KeepTheBeats,項目名稱:alevin-svn2,代碼行數:48,代碼來源:EditConstraintDialog.java

示例5: BaseDialog

import javax.swing.JTextField; //導入方法依賴的package包/類
/**
 * Set up and show the dialog. The first Component argument determines which
 * frame the dialog depends on; it should be a component in the dialog's
 * controlling frame. The second Component argument should be null if you
 * want the dialog to come up with its left corner in the center of the
 * screen; otherwise, it should be the component on top of which the dialog
 * should appear.
 */

public BaseDialog(Component frameComp, Component locationComp,
		String title, I_TickerManager tickerManager) {
	super(JOptionPane.getFrameForComponent(frameComp), title, true);
	this.frameComp = frameComp;
	dateChooser = new JDateChooser(Calendar.getInstance().getTime());
	dateChooser.setLocale(new Locale("fi", "FI"));

	this.tickerManager = tickerManager;

	// Create and initialize the buttons.
	cancelButton = new JButton(BUTTON_CANCEL);
	cancelButton.addActionListener(this);
	cancelButton.setActionCommand(BUTTON_CANCEL);

	okButton = new JButton(BUTTON_OK);
	okButton.setActionCommand(BUTTON_OK);
	okButton.addActionListener(this);
	getRootPane().setDefaultButton(okButton);
	okButton.setEnabled(false);

	rateField = new JTextField(FIELD_LEN);
	rateField.setVisible(true);
	rateField.setText("1.0000");

	rateFieldLabel = new JLabel("Valuuttakurssi: ");
	rateFieldLabel.setLabelFor(rateField);
	rateFieldLabel.setVisible(true);

	localCurrencyButton = new JRadioButton(localCurrencyString);
	foreignCurrencyButton = new JRadioButton(foreignCurrencyString);
	currencyGroup = new ButtonGroup();

	localCurrencyButton.setActionCommand(localCurrencyString);
	foreignCurrencyButton.setActionCommand(foreignCurrencyString);
	localCurrencyButton.setSelected(true);
	currencyGroup.add(localCurrencyButton);
	currencyGroup.add(foreignCurrencyButton);
	updateRateFieldCcy("EUR", false);
	localCurrencyButton.addActionListener(this);
	foreignCurrencyButton.addActionListener(this);
	foreignCurrencyButton.setEnabled(false);
	
}
 
開發者ID:skarna1,項目名稱:javaportfolio,代碼行數:53,代碼來源:BaseDialog.java


注:本文中的javax.swing.JTextField.setVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。