当前位置: 首页>>代码示例>>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;未经允许,请勿转载。