本文整理汇总了Java中javax.swing.JCheckBox.setHorizontalTextPosition方法的典型用法代码示例。如果您正苦于以下问题:Java JCheckBox.setHorizontalTextPosition方法的具体用法?Java JCheckBox.setHorizontalTextPosition怎么用?Java JCheckBox.setHorizontalTextPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JCheckBox
的用法示例。
在下文中一共展示了JCheckBox.setHorizontalTextPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ShowNextTime
import javax.swing.JCheckBox; //导入方法依赖的package包/类
/** Creates a new instance of RecentProjects */
public ShowNextTime() {
super( new BorderLayout() );
setOpaque(false);
button = new JCheckBox( BundleSupport.getLabel( "ShowOnStartup" ) ); // NOI18N
button.setSelected( WelcomeOptions.getDefault().isShowOnStartup() );
button.setOpaque( false );
button.setForeground( Color.white );
button.setHorizontalTextPosition( SwingConstants.LEFT );
BundleSupport.setAccessibilityProperties( button, "ShowOnStartup" ); //NOI18N
add( button, BorderLayout.CENTER );
button.addActionListener( this );
}
示例2: 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;
}
示例3: addNewCheckbox
import javax.swing.JCheckBox; //导入方法依赖的package包/类
private static JCheckBox addNewCheckbox(String text, String configString, Boolean configBool) {
JCheckBox checkbox = new JCheckBox(text, Utils.getConfigBoolean(configString, configBool));
checkbox.setHorizontalAlignment(JCheckBox.RIGHT);
checkbox.setHorizontalTextPosition(JCheckBox.LEFT);
return checkbox;
}
示例4: BooleanControl
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public BooleanControl(final Object f, PropertyDescriptor p) {
super();
final String name = p.getName();
final Method r = p.getReadMethod(), w = p.getWriteMethod();
setterMap.put(name, this);
clazz = f;
write = w;
read = r;
setLayout(new GridLayout(1, 0));
// setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
setAlignmentX(ALIGNMENT);
// setLayout(new FlowLayout(FlowLayout.LEADING));
JLabel label=new JLabel(name);
label.setAlignmentX(ALIGNMENT);
label.setHorizontalTextPosition(SwingConstants.LEFT);
label.setFont(label.getFont().deriveFont(fontSize));
add(label);
addTip(p,label);
checkBox = new JCheckBox();
refresh();
checkBox.setAlignmentX(ALIGNMENT);
checkBox.setHorizontalAlignment(SwingConstants.LEFT);
checkBox.setHorizontalTextPosition(SwingConstants.LEFT);
// checkBox.setBorder(new EmptyBorder(0,0,0,0));
// Border border=checkBox.getBorder();
// Insets insets=border.getBorderInsets(this);
// insets.left=0;
addTip(p, checkBox);
add(checkBox);
checkBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
w.invoke(clazz, checkBox.isSelected());
} catch (InvocationTargetException ite) {
ite.printStackTrace();
} catch (Exception iae) {
iae.printStackTrace();
}
}
});
}