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


Java JCheckBox.setToolTipText方法代码示例

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


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

示例1: init

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void init() {
    btnTestFileNamePattern = new JButton();
    chkFileNameRegex = new JCheckBox();
    chkFileNameRegex.setToolTipText(UiUtils.getText(
            "BasicSearchForm.chkFileNameRegex.tooltip"));           //NOI18N

    if (!replacing) {
        chkArchives = new JCheckBox();
        chkGenerated = new JCheckBox();
    }
    chkUseIgnoreList = new JCheckBox();
    btnEditIgnoreList = new JButton();
    checkBoxListener = new CheckBoxListener();

    component.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
    setMnemonics();
    initIgnoreListControlComponents();
    initScopeOptionsRow(replacing);
    initInteraction();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ScopeOptionsController.java

示例2: initDashField

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void initDashField(){
	
	JCheckBox rankOne = new JCheckBox("", json.get(jpath[0]).getAsBoolean());
	JCheckBox rankTwo = new JCheckBox("", json.get(jpath[1]).getAsBoolean());
	
	rankOne.setToolTipText("Mothwing Cloak");
	rankTwo.setToolTipText("Shadow Cloak");
	
	BoolCheckboxListener bcl1 = new BoolCheckboxListener(rankOne, json, jpath[0]); 
	BoolCheckboxListener bcl2 = new BoolCheckboxListener(rankTwo, json, jpath[1]); 
	
	rankOne.addActionListener(bcl1);
	rankTwo.addActionListener(bcl2);
	
	JPanel container = new JPanel();
	container.add(rankOne);
	container.add(rankTwo);
	this.add(container, BorderLayout.LINE_START);
}
 
开发者ID:KayDeeTee,项目名称:Hollow-Knight-SaveManager,代码行数:20,代码来源:SaveField.java

示例3: createBooleanOption

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private JComponent createBooleanOption(OptionDescriptor option, Preferences prefs)  {
    JCheckBox checkBox = new JCheckBox();

    org.openide.awt.Mnemonics.setLocalizedText(checkBox, option.displayName);
    checkBox.setToolTipText(option.tooltip);
    checkBox.addActionListener(new ActionListenerImpl(option.preferencesKey, prefs));

    checkBox.setSelected(prefs.getBoolean(option.preferencesKey, 
            Boolean.TRUE == option.defaultValue));
    prefs.putBoolean(option.preferencesKey, checkBox.isSelected());
    GridBagConstraints constraints = new GridBagConstraints();

    constraints.anchor = GridBagConstraints.WEST;
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridheight = 1;
    constraints.gridwidth = 2;
    constraints.gridx = 0;
    constraints.gridy = row++;
    constraints.weightx = 0;
    constraints.weighty = 0;

    add(checkBox, constraints);
    return checkBox;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:ReflectiveCustomizerProvider.java

示例4: initDreamField

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void initDreamField(){
	JCheckBox rankOne = new JCheckBox("",json.get(jpath[0]).getAsBoolean());
	JCheckBox rankTwo = new JCheckBox("",json.get(jpath[1]).getAsBoolean());
	JCheckBox rankThr = new JCheckBox("",json.get(jpath[2]).getAsBoolean());
	
	rankOne.setToolTipText("Dreamnail");
	rankTwo.setToolTipText("Dreamgate");
	rankThr.setToolTipText("Awakened Dreamnail");
	
	BoolCheckboxListener bcl1 = new BoolCheckboxListener(rankOne, json, jpath[0]); 
	BoolCheckboxListener bcl2 = new BoolCheckboxListener(rankTwo, json, jpath[1]); 
	BoolCheckboxListener bcl3 = new BoolCheckboxListener(rankThr, json, jpath[2]); 
	
	rankOne.addActionListener(bcl1);
	rankTwo.addActionListener(bcl2);
	rankThr.addActionListener(bcl3);
	
	JPanel container = new JPanel();
	container.add(rankOne);
	container.add(rankTwo);
	container.add(rankThr);
	this.add(container, BorderLayout.LINE_START);
}
 
开发者ID:KayDeeTee,项目名称:Hollow-Knight-SaveManager,代码行数:24,代码来源:SaveField.java

示例5: setCheckBoxValue

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void setCheckBoxValue(Boolean value, boolean defValue, JCheckBox component) {
    if (value != null) {
        component.setSelected(value.booleanValue());
        component.setToolTipText(null);
        inherited = false;
        component.setFont(component.getFont().deriveFont(Font.BOLD));
    } else {
        component.setSelected(defValue);
        component.setToolTipText(MSG_Value_Inherited());
        inherited = true;
        component.setFont(component.getFont().deriveFont(Font.PLAIN));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:CheckBoxUpdater.java

示例6: createCheckBoxes

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
 * Creates a specified set of checkboxes.
 * The checkboxes are specified by unique identifiers.
 * The identifiers are given by this class's constants <code>CHK_xxx</code>.
 * <p>
 * The array of strings passed as the argument may also contain
 * <code>null</code> items. In such a case, the resulting array
 * of check-boxes will contain <code>null</code>s on the corresponding
 * possitions.
 *
 * @param  ids  identifiers of the checkboxes to be created
 * @return  array of checkboxes corresponding to the array of identifiers
 *          passed as the argument
 */
public static JCheckBox[] createCheckBoxes(String[] ids) {
    JCheckBox[] chkBoxes = new JCheckBox[ids.length];
    
    if (chkBoxes.length == 0) {
        return chkBoxes;
    }
    
    ResourceBundle bundle = NbBundle.getBundle(GuiUtils.class);
    for (int i = 0; i < ids.length; i++) {
        String id = ids[i];
        
        if (id == null) {
            chkBoxes[i] = null;
            continue;
        }
        
        JCheckBox chkBox = new JCheckBox();
        String baseName = "CommonTestsCfgOfCreate.chk" + id;              //NOI18N
        AccessibleContext accessCtx = chkBox.getAccessibleContext();
        Mnemonics.setLocalizedText(
                chkBox,
                bundle.getString(baseName + ".text"));              //NOI18N
        chkBox.setToolTipText(
                bundle.getString(baseName + ".toolTip"));           //NOI18N
        accessCtx.setAccessibleName(
                bundle.getString(baseName + ".AN"));                //NOI18N
        accessCtx.setAccessibleDescription(
                bundle.getString(baseName + ".AD"));                //NOI18N
        
        chkBoxes[i] = chkBox;
    }
    return chkBoxes;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:48,代码来源:GuiUtils.java

示例7: createComponent

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private JCheckBox createComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column) {
    EclipseProject project = projects[row];
    JCheckBox chb = new JCheckBox();
    chb.setSelected(selectedProjects.contains(project) ||
            requiredProjects.contains(project));
    chb.setToolTipText(null);
    if (project.isImportSupported() && !requiredProjects.contains(project)) {
        chb.setEnabled(true);
    } else {
        // required and non-java project are disabled
        chb.setEnabled(false);
        if (!project.isImportSupported()) {
            chb.setToolTipText(ProjectImporterWizard.getMessage(
                    "MSG_NonJavaProject", project.getName())); // NOI18N
        }
    }
    if (isSelected) {
        chb.setOpaque(true);
        chb.setForeground(table.getSelectionForeground());
        chb.setBackground(table.getSelectionBackground());
    } else {
        chb.setOpaque(false);
        chb.setForeground(table.getForeground());
        chb.setBackground(table.getBackground());
    }
    return chb;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:ProjectSelectionPanel.java

示例8: rebuildVisibilityToolBar

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
 * Creates a JCheckBox for every series and add it to the JToolBar
 */
private void rebuildVisibilityToolBar(){
	
	this.getJToolBarSeriesVisibility().removeAll();

	// Iterate over all series
	int seriesCount = this.getChart().getXYPlot().getDataset().getSeriesCount();
	for(int i=0; i<seriesCount; i++){
		
		// Create JCheckBox for this series
		Series series = parent.getDataModel().getChartModel().getSeries(i);
		JCheckBox seriesCheckBox = new JCheckBox((String)series.getKey());
		seriesCheckBox.addActionListener(this);
		
		// Set state according to current visibility
		boolean currentlyVisible = this.getChart().getXYPlot().getRenderer().getItemVisible(i, 0);
		seriesCheckBox.setSelected(currentlyVisible);
		
		seriesCheckBox.setToolTipText(this.generateToolTipTextForVisibilityCheckBox(seriesCheckBox));
		
		// Add to the JToolBar
		this.getJToolBarSeriesVisibility().add(seriesCheckBox);
	}
	
	this.getJToolBarSeriesVisibility().repaint();
	this.getJToolBarSeriesVisibility().revalidate();
	
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:31,代码来源:ChartTab.java

示例9: actionPerformed

import javax.swing.JCheckBox; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent ae) {
	
	// Visibility checkbox - show or hide a series
	if(ae.getSource() instanceof JCheckBox){
		
		// Determine which series to hide
		JCheckBox source = (JCheckBox) ae.getSource();
		String seriesLabel = source.getText();

		// Find the series
		XYPlot plot = this.getChart().getXYPlot();
		for(int i=0; i<plot.getSeriesCount(); i++){
			
			// Toggle visibility
			if(plot.getDataset().getSeriesKey(i).equals(seriesLabel)){
				XYItemRenderer renderer = plot.getRenderer();
				boolean currentlyVisible = renderer.getItemVisible(i, 0);
				renderer.setSeriesVisible(i, new Boolean(!currentlyVisible));
			}
		}
		
		// Update the tooltip text to reflect the new state
		source.setToolTipText(this.generateToolTipTextForVisibilityCheckBox(source));
		
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:28,代码来源:ChartTab.java

示例10: createCollapseControl

import javax.swing.JCheckBox; //导入方法依赖的package包/类
protected Component createCollapseControl(String title, String tooltip) {
	Box box = Box.createHorizontalBox();
	expand = new JCheckBox(title);
	expand.setBorder(new EmptyBorder(0, 4, 0, 0));
	expand.setToolTipText(tooltip);
	expand.setHorizontalTextPosition(JCheckBox.RIGHT);
	expand.setIcon(new ArrowIcon(ArrowIcon.EAST));
	setCollapsedIcon(new ArrowIcon(ArrowIcon.EAST));
	setExpandedIcon(new ArrowIcon(ArrowIcon.SOUTH));
	expand.setSelected(isExpanded());
	expand.setFocusPainted(false);
	expand.addChangeListener(new CollapseListener());
	box.add(expand);
	return box;
}
 
开发者ID:kristian,项目名称:JDigitalSimulator,代码行数:16,代码来源:CollapsiblePanel.java

示例11: addTip

import javax.swing.JCheckBox; //导入方法依赖的package包/类
void addTip(Controllable f, JCheckBox label) {
    String s = f.getPropertyTooltip(label.getText());
    if (s == null) {
        return;
    }
    label.setToolTipText(s);
    label.setForeground(Color.BLUE);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:9,代码来源:ControlPanel.java

示例12: addTip

import javax.swing.JCheckBox; //导入方法依赖的package包/类
void addTip(ParameterContainer f, JCheckBox label) {
    String s = f.getPropertyTooltip(label.getText());
    if (s == null) {
        return;
    }
    label.setToolTipText(s);
    label.setForeground(Color.BLUE);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:9,代码来源:ParameterBrowserPanel.java

示例13: addTip

import javax.swing.JCheckBox; //导入方法依赖的package包/类
void addTip(EventFilter f, JCheckBox label) {
    String s = f.getPropertyTooltip(label.getText());
    if (s == null) {
        return;
    }
    label.setToolTipText(s);
    label.setForeground(Color.BLUE);

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

示例14: SnifferControl

import javax.swing.JCheckBox; //导入方法依赖的package包/类
public SnifferControl() {
	super();
	setLayout(new FlowLayout(FlowLayout.LEFT, 2, 0));
	_hostIpTextField = new JTextField(17);
	_hostIpTextField.setText(Resources.getLabel("sniffer.host.tooltip"));
	final FirstInputListener listener = new FirstInputListener(_hostIpTextField);
	_hostIpTextField.addMouseListener(listener);
	_hostIpTextField.addKeyListener(listener);
	_hostIpTextField.setToolTipText(Resources.getLabel("sniffer.host.tooltip"));
	add(_hostIpTextField);

	final JLabel protocolLabel = new JLabel(Resources.getLabel("protocol.label"));
	protocolLabel.setToolTipText(Resources.getLabel("protocol.desc"));
	add(protocolLabel);
	for (final Protocol type : Protocol.values()) {
		if (type == Protocol.OTHER) {
			continue;
		}
		final JCheckBox check = new JCheckBox(type.name(), type == Protocol.TCP);
		_packets.put(type, check);
		add(check);
	}
	final JLabel portLabel = new JLabel(Resources.getLabel("port.label"));
	portLabel.setToolTipText(Resources.getLabel("port.desc"));
	_allPortCheck = new JCheckBox(Resources.getLabel("all.port.label"));
	_allPortCheck.setToolTipText(Resources.getLabel("all.port.desc"));
	_allPortCheck.setSelected(false);
	add(_allPortCheck);

	_portTF = new JFormattedTextField();
	_portTF.setText("80,443");
	_portTF.setColumns(15);
	//			_portTF.setMaximumSize(new Dimension(30, _portTF.getPreferredSize().height));
	add(portLabel);
	add(_portTF);
	_portTF.setEnabled(true);

	_allPortCheck.addChangeListener(e -> _portTF.setEnabled(!_allPortCheck.isSelected()));

	_filterPacketLengthCheck = new JCheckBox(Resources.getLabel("filter.length"));
	_filterPacketLengthCheck.setToolTipText(Resources.getLabel("filter.length.desc"));
	_filterPacketLengthCheck.setSelected(false);
	add(_filterPacketLengthCheck);

	_filterLengthTF = new JFormattedTextField(new NumberFormatterFactory());
	_filterLengthTF.setText("128");
	_filterLengthTF.setColumns(5);
	add(_filterLengthTF);

	_filterPacketLengthCheck.addChangeListener(e -> _filterLengthTF.setEnabled(_filterPacketLengthCheck.isEnabled() && _filterPacketLengthCheck.isSelected()));
	_capturePeriod = new JFormattedTextField(new NumberFormatterFactory());
	_capturePeriod.setText("0");
	_capturePeriod.setColumns(5);
	add(new JLabel(Resources.getLabel("capture.period")));
	add(_capturePeriod);

	_captureButton = new JButton(GO_IMG);
	_captureButton.setToolTipText(Resources.getLabel("capture.packet.start"));
	add(_captureButton);
	_captureButton.addActionListener(arg0 -> start());
}
 
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:62,代码来源:ControlPanel.java

示例15: initComponents

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
 * Initialize layout
 */
private void initComponents() {
	//building mainPanel
	this.setLayout(new GridLayout(2, 1));
	this.setBorder(new EmptyBorder(5, 5, 5, 5));
	
	//layout of block panel
	JPanel block = new JPanel(new BorderLayout(10, 10));
	block.setBorder(new TitledBorder(new EtchedBorder(), "Fork-Join Section Capacity"));
	this.add(block);

	// Adds a checkbox to block panel to select block function
	final JCheckBox check = new JCheckBox();
	check.setText("Enable Finite Capacity: limit maximum number of jobs (customers) inside a fork-join section");
	check.setToolTipText("Limit the maximum number of jobs allowed inside a fork-join section. Following jobs will be queued.");

	// Adds a spinner to block panel to select block number
	JLabel label = new JLabel("Capacity (max number of jobs, NOT tasks): ");
	label.setLabelFor(blockSpinner);

	// Initial values
	if (sd.getForkBlock(stationKey).intValue() < 0) {
		check.setSelected(false);
		blockSpinner.setValue(Float.POSITIVE_INFINITY);
		blockSpinner.setEnabled(false);
	} else {
		check.setSelected(true);
		blockSpinner.setValue(sd.getForkBlock(stationKey));
		blockSpinner.setEnabled(true);
	}

	// Adds action listeners
	check.addActionListener(new ActionListener() {
		/**
		 * Toggles block property
		 */
		public void actionPerformed(ActionEvent e) {
			if (check.isSelected()) {
				if (Defaults.getAsInteger("forkBlock").intValue() > 0) {
					sd.setForkBlock(stationKey, Defaults.getAsInteger("forkBlock"));
				} else {
					sd.setForkBlock(stationKey, new Integer(1));
				}
				blockSpinner.setValue(sd.getForkBlock(stationKey));
				blockSpinner.setEnabled(true);
			} else {
				sd.setForkBlock(stationKey, new Integer(-1));
				blockSpinner.setValue(Float.POSITIVE_INFINITY);
				blockSpinner.setEnabled(false);
			}
		}
	});

	// Creates a temp panel for blockSpinner and its label
	JPanel tmp = new JPanel();
	tmp.add(label);
	tmp.add(blockSpinner);

	block.add(check, BorderLayout.NORTH);
	block.add(tmp, BorderLayout.CENTER);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:64,代码来源:ForkSectionPanel.java


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