javafx.scene.control.Tab.setGraphic()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(211)

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

Tab.setGraphic介绍

暂无

代码示例

代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx

/**
 * set the icon for the tab
 * 
 * @param tab
 * @param icon
 */
public void setTabIcon(Tab tab, Node icon) {
 if (icon != null)
  tab.setGraphic(icon);
}

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

void loadFavicon(String location, Tab tab) {
try {
 String faviconUrl = String.format("http://www.google.com/s2/favicons?domain_url=%s", URLEncoder.encode(location, "UTF-8"));
 Image favicon = new Image(faviconUrl, true);
 ImageView iv = new ImageView(favicon);
 tab.setGraphic(iv);
} catch (UnsupportedEncodingException ex) {
 throw new RuntimeException(ex); // not expected
}

代码示例来源:origin: de.jensd/fontawesomefx-common

public void setIcon(Tab tab, GlyphIcons icon, String iconSize) {
  tab.setGraphic(createIcon(icon, iconSize));
}

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

public void addIcon(Tab component, FontAwesome.Glyph icon) {
  if (icon != null) {
    component.setGraphic(getFontAwesome().create(icon));
  }
}

代码示例来源:origin: org.gillius/jfxutils

/**
 * Helper method to create a new tab with the given label and make it draggable with {@link #makeDraggable}.
 */
public static Tab newDraggableTab( String label ) {
  Tab rr = new Tab();
  rr.setGraphic( new Label( label ) );
  makeDraggable( rr );
  return rr;
}

代码示例来源:origin: com.github.giulianini.jestures/jestures

private void initGraphic() {
  this.tabPane.getTabs().get(0).setGraphic(ViewUtilities.iconSetter(Material.PERSON, IconDim.MEDIUM));
  this.tabPane.getTabs().get(1).setGraphic(ViewUtilities.iconSetter(Material.BLUR_ON, IconDim.MEDIUM));
  this.tabPane.getTabs().get(2).setGraphic(ViewUtilities.iconSetter(Material.MULTILINE_CHART, IconDim.MEDIUM));
  this.tabPane.getTabs().get(3).setGraphic(ViewUtilities.iconSetter(Material.SETTINGS, IconDim.MEDIUM));
  this.startButton.setGraphic(ViewUtilities.iconSetter(Material.VISIBILITY, IconDim.MEDIUM));
}

代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx

/**
 * create an XYTab Pane with the given iconSize
 * 
 * @param iconSize
 *          - e.g. 48
 */
public XYTabPane(int iconSize) {
 super();
 this.iconSize = iconSize;
 this.currentTab = TabSelection.getInstance();
 setvTabPane(this.addTabPane("vTabPane"));
 getvTabPane().setSide(Side.LEFT);
 Tab filler = new Tab();
 topLeftButton = new Button();
 int tabSize = getTabSize();
 topLeftButton.setMinSize(tabSize, tabSize);
 topLeftButton.setMaxSize(tabSize, tabSize);
 topLeftButton.setDisable(true);
 filler.setGraphic(topLeftButton);
 filler.setDisable(true);
 getvTabPane().getTabs().add(filler);
 this.addToMaps(filler, vTabPane);
 fontAwesome = GlyphFontRegistry.font("FontAwesome");
 super.getChildren().add(getvTabPane());
}

代码示例来源:origin: com.powsybl/powsybl-gse-security-analysis

preContGraphic.setPrefWrapLength(150);
preContTab = new Tab("", preContResultPane);
preContTab.setGraphic(preContGraphic);
preContTab.setClosable(false);
postContGraphic.setPrefWrapLength(150);
postContTab = new Tab("", postContResultPane);
postContTab.setGraphic(postContGraphic);
postContTab.setClosable(false);

代码示例来源:origin: com.aquafx-project/aquafx

pages.setPreserveRatio(true);
pages.setFitHeight(36);
tab1.setGraphic(pages);
Label label =new Label("Allgemein...");
label.setPadding(new Insets(15));
layout.setPreserveRatio(true);
layout.setFitHeight(36);
tab2.setGraphic(layout);
Label label2 = new Label("Etiketten");
label2.setPadding(new Insets(15));
umbruch.setPreserveRatio(true);
umbruch.setFitHeight(36);
tab3.setGraphic(umbruch);
Label label3 = new Label("seitenleiste...");
label3.setPadding(new Insets(15));
text.setPreserveRatio(true);
text.setFitHeight(36);
tab4.setGraphic(text);

代码示例来源:origin: com.aquafx-project/aquafx

pages.setPreserveRatio(true);
pages.setFitHeight(16);
tab1.setGraphic(pages);
Label label = new Label("Dokument...");
label.setPadding(new Insets(15));
layout.setPreserveRatio(true);
layout.setFitHeight(16);
tab2.setGraphic(layout);
Label label2 = new Label("layout");
label2.setPadding(new Insets(15));
umbruch.setPreserveRatio(true);
umbruch.setFitHeight(16);
tab3.setGraphic(umbruch);
Label label3 = new Label("Zeilenumbruch...");
label3.setPadding(new Insets(15));
text.setPreserveRatio(true);
text.setFitHeight(16);
tab4.setGraphic(text);
Label label4 = new Label("Zeilenumbruch...");
label4.setPadding(new Insets(15));
grafik.setPreserveRatio(true);
grafik.setFitHeight(16);
tab5.setGraphic(grafik);
Label label5 = new Label("Zeilenumbruch...");
label5.setPadding(new Insets(15));

相关文章