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

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

本文整理了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

  1. protected static JButton smallButton(final String text) {
  2. final double SCALE = .85;
  3. final JButton button = new JButton(text);
  4. final Font font = button.getFont();
  5. button.setFont(font.deriveFont((float) (font.getSize() * SCALE)));
  6. final Insets insets = button.getMargin();
  7. button.setMargin(new Insets((int) (insets.top * SCALE), (int) (insets.left * SCALE),
  8. (int) (insets.bottom * SCALE), (int) (insets.right * SCALE)));
  9. return button;
  10. }

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

  1. /** Returns the insets of this button. They depend upon whether
  2. * the button touches the parent's edges or not .
  3. */
  4. public Insets getBorderInsets(Component c)
  5. {
  6. Insets m=null;
  7. if(c instanceof JButton)
  8. {
  9. m=((JButton)c).getMargin();
  10. }
  11. int left=(!isTouchingLeftEdge(c) ? 4 : 3) + m.left;
  12. int right=(!isTouchingRightEdge(c) ? 4 : 3) +m.right;
  13. int top=(!isTouchingTopEdge(c) ? 4 : 3) + m.top;
  14. int bottom=(!isTouchingBottomEdge(c) ? 4 : 3) +m.bottom;
  15. return new Insets(top, left, bottom, right);
  16. }

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

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

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

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

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

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

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

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

相关文章

JButton类方法