javax.swing.JButton.getMargin()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中javax.swing.JButton.getMargin()方法的一些代码示例,展示了JButton.getMargin()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JButton.getMargin()方法的具体详情如下:
包路径:javax.swing.JButton
类名称:JButton
方法名:getMargin

JButton.getMargin介绍

暂无

代码示例

代码示例来源:origin: sc.fiji/Simple_Neurite_Tracer

protected static JButton smallButton(final String text) {
  final double SCALE = .85;
  final JButton button = new JButton(text);
  final Font font = button.getFont();
  button.setFont(font.deriveFont((float) (font.getSize() * SCALE)));
  final Insets insets = button.getMargin();
  button.setMargin(new Insets((int) (insets.top * SCALE), (int) (insets.left * SCALE),
      (int) (insets.bottom * SCALE), (int) (insets.right * SCALE)));
  return button;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

/**	Returns the insets of this button. They depend upon whether
 *     the button touches the parent's edges or not .
 */
public Insets getBorderInsets(Component c)
{
  Insets m=null;
  if(c instanceof JButton)
  {
    m=((JButton)c).getMargin();			
  }
    
  int left=(!isTouchingLeftEdge(c) ? 4 : 3) + m.left;
  int right=(!isTouchingRightEdge(c) ? 4 : 3) +m.right;
  int top=(!isTouchingTopEdge(c) ? 4 : 3) + m.top;
  int bottom=(!isTouchingBottomEdge(c) ? 4 : 3) +m.bottom;
  
  return new Insets(top, left, bottom, right);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

Insets m=((JButton)c).getMargin();
if(m!=null)

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-designer

java.awt.Insets insets = button.getMargin();

代码示例来源:origin: com.github.arnabk/pgslookandfeel

editor != null) {
size = super.getMinimumSize(c);
Insets margin = arrowButton.getMargin();
size.height += margin.top + margin.bottom - 2;
size.width += margin.left + margin.right;

代码示例来源:origin: org.jclarion/clarion-runtime

Insets i = button.getMargin();
i.left = 0;
i.right = 0;

相关文章

微信公众号

最新文章

更多

JButton类方法