本文整理了Java中javax.swing.JToolBar.createActionComponent()
方法的一些代码示例,展示了JToolBar.createActionComponent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToolBar.createActionComponent()
方法的具体详情如下:
包路径:javax.swing.JToolBar
类名称:JToolBar
方法名:createActionComponent
暂无
代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui
protected JButton createActionComponent(Action a) {
JButton b = super.createActionComponent(a);
if (buttonStyle == BUTTON_STYLE_VERICAL) {
b.putClientProperty("hideActionText", Boolean.FALSE); //NOI18N
String iconBase = (String) a.getValue("iconBase"); //NOI18N
if (iconBase != null) {
try {
System.err.println("URL for: " + insertBeforeSuffix(iconBase, "32")); //NOI18N
URL url = a.getClass().getResource(insertBeforeSuffix(iconBase, "32")); //NOI18N
System.err.println("is: " + url); //NOI18N
b.setIcon(new ImageIcon(url));
} catch (Exception e) {
e.printStackTrace(System.err);
}
}
}
return b;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-dlight-visualizers
@Override
protected JButton createActionComponent(Action a) {
JButton b = super.createActionComponent(a);
if (buttonStyle == BUTTON_STYLE_VERICAL) {
b.putClientProperty("hideActionText", Boolean.FALSE); //NOI18N
String iconBase = (String) a.getValue("iconBase"); //NOI18N
if (iconBase != null) {
try {
System.err.println("URL for: " + insertBeforeSuffix(iconBase, "32")); //NOI18N
URL url = a.getClass().getResource(insertBeforeSuffix(iconBase, "32")); //NOI18N
System.err.println("is: " + url); //NOI18N
b.setIcon(new ImageIcon(url));
} catch (Exception e) {
e.printStackTrace(System.err);
}
}
}
return b;
}
代码示例来源:origin: org.terracotta.modules/tim-ehcache-2.x-ui
@Override
protected JButton createActionComponent(Action a) {
JButton b = super.createActionComponent(a);
b.setHorizontalTextPosition(SwingConstants.TRAILING);
b.setVerticalTextPosition(SwingConstants.CENTER);
b.putClientProperty("hideActionText", Boolean.FALSE);
Class<?> bClass = b.getClass();
for (Field field : bClass.getDeclaredFields()) {
if (field.getName().equals("hideActionText")) {
try {
field.setAccessible(true);
field.setBoolean(b, false);
} catch (Exception e) {/**/
}
}
}
return b;
}
}
代码示例来源:origin: org.terracotta.modules/tim-quartz-ui
@Override
protected JButton createActionComponent(Action a) {
JButton b = super.createActionComponent(a);
b.setHorizontalTextPosition(SwingConstants.TRAILING);
b.setVerticalTextPosition(SwingConstants.CENTER);
b.putClientProperty("hideActionText", Boolean.FALSE);
Class<?> bClass = b.getClass();
for (Field field : bClass.getDeclaredFields()) {
if (field.getName().equals("hideActionText")) {
try {
field.setAccessible(true);
field.setBoolean(b, false);
} catch (Exception e) {/**/
}
}
}
return b;
}
}
内容来源于网络,如有侵权,请联系作者删除!