javax.swing.JPanel.getBorder()方法的使用及代码示例

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

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

JPanel.getBorder介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

public static void setTitle (JPanel panel, String title) {
  Border border = panel.getBorder();
  if (border instanceof TitledBorder) {
    ((TitledBorder) panel.getBorder()).setTitle(title);
    panel.repaint();
  } else {
    panel.setBorder(BorderFactory.createTitledBorder(title));
  }
}

代码示例来源:origin: magefree/mage

"Import from Clipboard", javax.swing.border.TitledBorder.CENTER,
javax.swing.border.TitledBorder.TOP, new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12),
java.awt.Color.BLACK), contentPane.getBorder()));

代码示例来源:origin: magefree/mage

"Download Images from Copy/Pasted Text", javax.swing.border.TitledBorder.CENTER,
javax.swing.border.TitledBorder.TOP, new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12),
java.awt.Color.BLACK), contentPane.getBorder()));

代码示例来源:origin: jdmp/java-data-mining-package

public TitledBorder getBorder() {
  return (TitledBorder) super.getBorder();
}

代码示例来源:origin: jdmp/java-data-mining-package

public TitledBorder getBorder() {
  return (TitledBorder) super.getBorder();
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

public Border getBorder()
{
 if( _tabPane != null && !_tabPane.isShowing() )
 {
  return null;
 }
 return super.getBorder();
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * default constructor
 */
public ThresholdVisualizePanel() {
 super();
 // Save the current border text
 TitledBorder tb = (TitledBorder) m_plotSurround.getBorder();
 m_savePanelBorderText = tb.getTitle();
}

代码示例来源:origin: stackoverflow.com

JPanel addressPanel = new JPanel();
 Border border = addressPanel.getBorder();
 Border margin = new EmptyBorder(10, 10, 10, 10);
 addressPanel.setBorder(new CompoundBorder(border, margin));
 GridBagLayout panelGridBagLayout = new GridBagLayout();
 panelGridBagLayout.columnWidths = new int[] { 86, 86, 0 };
 panelGridBagLayout.rowHeights = new int[] { 20, 20, 20, 20, 20, 0 };
 panelGridBagLayout.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
 panelGridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
 addressPanel.setLayout(panelGridBagLayout);
 addLabelAndTextField("City:", 0, addressPanel);
 addLabelAndTextField("Street:", 1, addressPanel);
 addLabelAndTextField("State:", 2, addressPanel);
 addLabelAndTextField("Phone:", 3, addressPanel);
 addLabelAndTextField("Mail:", 4, addressPanel);

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

public Border getBorder()
{
 if( _tabPane != null && !_tabPane.isShowing() )
 {
  return null;
 }
 return super.getBorder();
}

代码示例来源:origin: edu.stanford.protege/org.protege.ontograf

public void typeVisibilityChanged(Object type, boolean visible) {
    String title = ((TitledBorder)panel.getBorder()).getTitle();
    if(title.equals("Class Tooltip Options:")) {
      TooltipConfigurationDialog.this.typeVisibilityChanged(type, visible);
    }
    else {
      typeIndividualVisibilityChanged(type, visible);
    }
  }
};

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * default constructor
 */
public ThresholdVisualizePanel() {
 super();
 // Save the current border text
 TitledBorder tb = (TitledBorder) m_plotSurround.getBorder();
 m_savePanelBorderText = tb.getTitle();
}

代码示例来源:origin: net.java.dev.swing-layout/swing-layout

private static int getPanelBaselineResizeBehavior(JPanel panel) {
  Border b = panel.getBorder();
  if (b instanceof TitledBorder) {
    switch(((TitledBorder)b).getTitlePosition()) {
      case TitledBorder.ABOVE_TOP:
      case TitledBorder.TOP:
      case TitledBorder.DEFAULT_POSITION:
      case TitledBorder.BELOW_TOP:
        return BRB_CONSTANT_ASCENT;
      case TitledBorder.ABOVE_BOTTOM:
      case TitledBorder.BOTTOM:
      case TitledBorder.BELOW_BOTTOM:
        return BRB_CONSTANT_DESCENT;
    }
  }
  return BRB_OTHER;
}

代码示例来源:origin: nroduit/Weasis

static void updateSliderProoperties(JSliderW slider, String title) {
  JPanel panel = (JPanel) slider.getParent();
  if (slider.isdisplayValueInTitle() && panel != null && panel.getBorder() instanceof TitledBorder) {
    ((TitledBorder) panel.getBorder()).setTitle(title);
    panel.repaint();
  } else {
    slider.setToolTipText(title);
  }
}

代码示例来源:origin: net.sf.ingenias/editor

public void paint(Graphics graph){
  // graph.setXORMode(Color.WHITE); // If activated, fonts are painted without anti-aliasing. They will look ugly.
 super.paint(graph); 
 if(inside!=null && inside.getBorder()!=null && inside.getBorder().isBorderOpaque()){
   Graphics2D g2d=(Graphics2D) graph;
 graph.drawRect(0,0,getSize().width,getSize().height);
 }
//  graph.setPaintMode();
}

代码示例来源:origin: xyz.cofe/docking-frames-ext-toolbar

@Override
public Insets getDockableInsets(){
  Insets insets = super.getDockableInsets();
  Border border = dockable.getBorder();
  if( border != null ){
    Insets borderInsets = border.getBorderInsets( dockable );
    insets.left += borderInsets.left;
    insets.right += borderInsets.right;
    insets.top += borderInsets.top;
    insets.bottom += borderInsets.bottom;
  }
  return insets;
}

代码示例来源:origin: xyz.cofe/docking-frames-core

@Override
public Insets getDockableInsets() {
  Insets insets = super.getDockableInsets();
  Border border = dockable.getBorder();
  if( border != null ){
    Insets borderInsets = border.getBorderInsets( dockable );
    insets.left += borderInsets.left;
    insets.right += borderInsets.right;
    insets.top += borderInsets.top;
    insets.bottom += borderInsets.bottom;
  }
  return insets;
}

代码示例来源:origin: omegat-org/omegat

private void init2(boolean sourceEncodingVariable, boolean targetEncodingVariable, String hint) {
  getRootPane().setDefaultButton(addOrUpdateButton);
  this.sourceEncodingField.setEnabled(sourceEncodingVariable);
  this.targetEncodingField.setEnabled(targetEncodingVariable);
  ((TitledBorder) tfnpPanel.getBorder()).setTitle(OStrings
      .getString("INSTANCEEDITOR_Target_Filename_Pattern"));
  sourceFilenameMaskField.setText("*.*");
  targetFilenamePatternField.setText("${filename}");
  hintTextArea.setText(hint);
  hintTextArea.setVisible(!StringUtil.isEmpty(hint));
  StaticUIUtils.setEscapeClosable(this);
  pack();
}

代码示例来源:origin: nroduit/Weasis

public void updateSliderProoperties(JSliderW slider) {
  JPanel panel = (JPanel) slider.getParent();
  String result = basicState.getActionW().getTitle() + StringUtil.COLON_AND_SPACE + getValueToDisplay();
  if (slider.isdisplayValueInTitle() && panel != null && panel.getBorder() instanceof TitledBorder) {
    ((TitledBorder) panel.getBorder()).setTitle(result);
    panel.repaint();
  } else {
    slider.setToolTipText(result);
  }
}

代码示例来源:origin: triplea-game/triplea

@Test
public void emptyBorderWithIndependentWidths() {
 final JPanel panel = JPanelBuilder.builder()
   .borderEmpty(1, 2, 3, 4)
   .build();
 assertThat(panel.getBorder(), instanceOf(EmptyBorder.class));
 final Insets insets = panel.getBorder().getBorderInsets(panel);
 assertThat(insets.top, is(1));
 assertThat(insets.left, is(2));
 assertThat(insets.bottom, is(3));
 assertThat(insets.right, is(4));
}

代码示例来源:origin: triplea-game/triplea

@Test
public void emptyBorderWithSingleWidth() {
 final int borderWidth = 100;
 final JPanel panel = JPanelBuilder.builder()
   .borderEmpty(borderWidth)
   .build();
 assertThat(panel.getBorder(), instanceOf(EmptyBorder.class));
 final Insets insets = panel.getBorder().getBorderInsets(panel);
 assertThat(insets.top, is(borderWidth));
 assertThat(insets.bottom, is(borderWidth));
 assertThat(insets.left, is(borderWidth));
 assertThat(insets.right, is(borderWidth));
}

相关文章

JPanel类方法