本文整理汇总了Java中javax.swing.JComponent.AccessibleJComponent方法的典型用法代码示例。如果您正苦于以下问题:Java JComponent.AccessibleJComponent方法的具体用法?Java JComponent.AccessibleJComponent怎么用?Java JComponent.AccessibleJComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JComponent
的用法示例。
在下文中一共展示了JComponent.AccessibleJComponent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAccessibleContext
import javax.swing.JComponent; //导入方法依赖的package包/类
public AccessibleContext getAccessibleContext() {
if (accessibleContext == null) {
accessibleContext = new JComponent.AccessibleJComponent() {
public AccessibleRole getAccessibleRole() {
return AccessibleRole.PANEL;
}
public String getAccessibleName() {
return Bundle.ProfilerWindow_accessName(getDisplayName());
}
public String getAccessibleDescription() {
ProfilerFeature selected = featuresView == null ? null :
featuresView.getSelectedFeature();
return selected == null ? WelcomePanel.CAPTION :
(selected.getName() + " " + selected.getDescription()); // NOI18N
}
};
}
return accessibleContext;
}
示例2: createAccesibleContext
import javax.swing.JComponent; //导入方法依赖的package包/类
protected AccessibleContext createAccesibleContext() {
return new JComponent.AccessibleJComponent() {
public AccessibleRole getAccessibleRole() {
return AccessibleRole.LABEL;
}
public String getAccessibleName() {
return BaseRenderer.this.toString();
}
};
}
示例3: assertGetLocation
import javax.swing.JComponent; //导入方法依赖的package包/类
private static void assertGetLocation() {
// the frame is now invisible
// test getLocationOnScreen() of
// JTable$AccessibleJTable$AccessibleJTableHeaderCell
// and JTable$AccessibleJTable$AccessibleJTableCell
AccessibleTable accessibleTable = (AccessibleTable) table
.getAccessibleContext();
AccessibleTable header = accessibleTable.getAccessibleColumnHeader();
AccessibleComponent accessibleComp1 = (AccessibleComponent) header
.getAccessibleAt(0, 0);
// getLocation() must be null according to its javadoc and no exception
// is thrown
if (null != accessibleComp1.getLocationOnScreen()) {
throw new RuntimeException(
"JTable$AccessibleJTable$AccessibleJTableHeaderCell."
+ "getLocation() must be null");
}
JComponent.AccessibleJComponent accessibleJComponent =
(JComponent.AccessibleJComponent) table.getAccessibleContext();
AccessibleComponent accessibleComp2 = (AccessibleComponent)
accessibleJComponent.getAccessibleChild(3);
// getLocation() must be null according to its javadoc and no exception
// is thrown
if (null != accessibleComp2.getLocationOnScreen()) {
throw new RuntimeException("JTable$AccessibleJTable$"
+ "AccessibleJTableCell.getLocation() must be null");
}
}
示例4: getAccessibleContext
import javax.swing.JComponent; //导入方法依赖的package包/类
public AccessibleContext getAccessibleContext() {
TreeCellRenderer renderer = getCellRenderer();
return renderer instanceof Accessible ?
((Accessible)renderer).getAccessibleContext() :
new JComponent.AccessibleJComponent() {};
}