本文整理了Java中javax.swing.JLabel.getLabelFor()
方法的一些代码示例,展示了JLabel.getLabelFor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.getLabelFor()
方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:getLabelFor
暂无
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-jellytools-ruby
public boolean checkComponent(Component comp) {
JLabel jLabel = (JLabel) comp;
String text = jLabel.getText();
if (text == null || nameAndLocationLabel.equals(text)) {
return false;
} else if (text.indexOf(nameLabel) > -1 && (jLabel.getLabelFor() == null || jLabel.getLabelFor() instanceof JTextField)) {
return true;
}
return false;
}
代码示例来源:origin: senbox-org/snap-desktop
private JLabel findLabelFor(JComponent component) {
Optional<Component> label = Arrays.stream(component.getParent().getComponents())
.filter(c -> c instanceof JLabel && component.equals(((JLabel) c).getLabelFor()))
.findFirst();
return label.map(component1 -> (JLabel) component1).orElse(null);
}
}
代码示例来源:origin: joel-costigliola/assertj-swing
@Nonnull private <T> T labelFor(@Nonnull Component label, @Nonnull Class<T> type) {
assertThat(label).isInstanceOf(JLabel.class);
Component target = ((JLabel) label).getLabelFor();
assertThat(target).isInstanceOf(type);
return type.cast(target);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-junit-ui
&& (((JLabel) opposite).getLabelFor() == tfClassToTest)) {
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-junit-ui
Component labelFor = lbl.getLabelFor();
if ((labelFor != null) && (labelFor != tfClassToTest)
&& (lbl.getDisplayedMnemonic() != 0)) {
代码示例来源:origin: com.jgoodies/jgoodiesforms
/**
* Checks and answers whether the given component shall be set
* as component for a previously added label using
* {@link JLabel#setLabelFor(Component)}.
*
* This default implementation checks whether the component is focusable,
* and - if a JComponent - whether it is already labeled by a JLabel.
* Subclasses may override.
*
* @param label the candidate for labeling {@code component}
* @param component the component that could be labeled by {@code label}
* @return true if focusable, false otherwise
*/
protected boolean isLabelForApplicable(JLabel label, Component component) {
// 1) Is the label labeling a component?
if (label.getLabelFor() != null) {
return false;
}
// 2) Is the component focusable?
if (!component.isFocusable()) {
return false;
}
// 3) Is the component labeled by another label?
if (!(component instanceof JComponent)) {
return true;
}
JComponent c = (JComponent) component;
return c.getClientProperty(LABELED_BY_PROPERTY) == null;
}
代码示例来源:origin: joel-costigliola/assertj-swing
return false;
Component labeled = labelForComponent.getLabelFor();
return type.isInstance(labeled) && requireShowingMatches(checkNotNull(labeled));
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu
if (c instanceof JLabel) {
JLabel lb = (JLabel) c;
if (lb.getLabelFor() == null) {
Component tg = (Component) v.elementAt(i + 1);
if (!tg.isFocusable() && (tg instanceof Container)) {
int mn = lb.getDisplayedMnemonic();
if (auto && (mn <= 0) && (lb.getLabelFor() != null)) {
String tx = candidateMnemonics(lb.getText());
if (tx != null) for (int j = 0; j < tx.length(); j++) {
代码示例来源:origin: stackoverflow.com
Component c = label.getLabelFor();
JTextField tf = (JTextField) c;
tf.setText(value);
Component c = label.getLabelFor();
JTextField tf = (JTextField) c;
prop.put(label.getText(), tf.getText());
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-junit-ui
&& (((JLabel) opposite).getLabelFor() == tfClassToTest)) {
内容来源于网络,如有侵权,请联系作者删除!