當前位置: 首頁>>代碼示例>>Java>>正文


Java TabPane.setSide方法代碼示例

本文整理匯總了Java中javafx.scene.control.TabPane.setSide方法的典型用法代碼示例。如果您正苦於以下問題:Java TabPane.setSide方法的具體用法?Java TabPane.setSide怎麽用?Java TabPane.setSide使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.TabPane的用法示例。


在下文中一共展示了TabPane.setSide方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TabSample

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
public TabSample() {
    BorderPane borderPane = new BorderPane();
    final TabPane tabPane = new TabPane();
    tabPane.setPrefSize(400, 400);
    tabPane.setSide(Side.TOP);
    tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
    final Tab tab1 = new Tab();
    tab1.setText("Tab 1");
    final Tab tab2 = new Tab();
    tab2.setText("Tab 2");
    final Tab tab3 = new Tab();
    tab3.setText("Tab 3");
    final Tab tab4 = new Tab();
    tab4.setText("Tab 4");
    tabPane.getTabs().addAll(tab1, tab2, tab3, tab4);
    borderPane.setCenter(tabPane);
    getChildren().add(borderPane);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:TabSample.java

示例2: DemoTab

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
private DemoTab(String title, String sourceFile) throws Exception {
    super(title);
    setClosable(false);

    TabPane content = new TabPane();
    setContent(content);
    content.setSide(Side.BOTTOM);

    Tab widgets = new Tab("Widgets");
    widgets.setClosable(false);
    URL location = getClass().getResource(sourceFile);
    FXMLLoader fxmlLoader = new FXMLLoader(location);
    Node node = fxmlLoader.load();
    widgets.setContent(node);

    Tab source = new Tab("Source");
    source.setClosable(false);
    XMLEditor editor = new XMLEditor();
    editor.setEditable(false);

    String text = lines(Paths.get(getClass().getResource(sourceFile).toURI())).collect(joining("\n"));
    editor.setText(text);
    source.setContent(editor);

    content.getTabs().addAll(widgets, source);
}
 
開發者ID:aalmiray,項目名稱:bootstrapfx,代碼行數:27,代碼來源:Sampler.java

示例3: createDescriptionPane

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
private TabPane createDescriptionPane() {
	final TabPane descriptionPane = new TabPane();
	descriptionPane.getTabs().add(createSnapshots2Tab());
	descriptionPane.getTabs().add(createDescriptionTab());
	descriptionPane.setSide(Side.LEFT);
	return descriptionPane;
}
 
開發者ID:mikelaud,項目名稱:fx-media-catalog,代碼行數:8,代碼來源:FxMediaCatalog.java

示例4: ExcelTemplateSkin

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
/**
 * @param excelTemplateControl
 */
public ExcelTemplateSkin(ExcelTemplateControl control) {
	super(control, new ExcelTemplateBehavior(control));
	this.control = control;

	root = new TabPane();
	root.setSide(Side.BOTTOM);
	getChildren().add(root);
}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:12,代碼來源:ExcelTemplateSkin.java

示例5: start

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
@Override
public void start(Stage stage, Scene scene, StackPane root, BorderPane border) throws Exception {
    OptionMenu.init();
    tb = new TabPane();
    menuBar = new MenuBar();
    bmread = new Reader(menuBook);
    bmread.refresh();

    mkDirs(home, saveDir, temp, cssDir);

    stage.getIcons().add(new Image(ZunoZap.class.getClassLoader().getResourceAsStream("zunozaplogo.gif")));
    tb.setPrefSize(1365, 768);
    tb.setSide(Side.TOP);

    /// Setup tabs
    Tab newtab = new Tab(" + ");
    newtab.setClosable(false);
    tb.getTabs().add(newtab);
    createTab(true);

    tb.getSelectionModel().selectedItemProperty().addListener((a,b,c) -> { if (c == newtab) createTab(false); });

    border.setCenter(tb);
    border.setTop(menuBar);
    border.autosize();

    WebView dummy = new WebView();
    setUserAgent(dummy.getEngine());
    regMenuItems(bmread, menuFile, menuBook, aboutPageHTML("Java WebView", dummy.getEngine().getUserAgent(), "ZunoZap/zunozap/master/LICENCE", "LGPLv3", "N/A"), tb, Engine.WEBKIT);
    menuBar.getMenus().addAll(menuFile, menuBook);
    sm = new StyleManager(cssDir, scene);
    scene.getStylesheets().add(ZunoAPI.stylesheet.toURI().toURL().toExternalForm());

    p.loadPlugins();
    if (allowPluginEvents()) for (PluginBase pl : p.plugins) pl.onLoad(stage, scene, tb);
}
 
開發者ID:ZunoZap,項目名稱:zunozap,代碼行數:37,代碼來源:ZunoZapWebView.java

示例6: generateScene

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
private Scene generateScene() {
    final TabPane tabPane = new TabPane();
    tabPane.setSide(Side.LEFT);

    this.log = new TextArea();
    final Tab logTab = new Tab("Log");
    logTab.setContent(this.log);
    logTab.setClosable(false);

    final Tab networkTab = new Tab("Network");
    networkTab.setClosable(false);
    final ScrollPane scrollPane = new ScrollPane();
    networkTab.setContent(scrollPane);

    this.networkVisualisation = new NetworkVisualisation(this.jamocha.getNetwork());
    this.networkVisualisation.setTranslateX(10);
    this.networkVisualisation.setTranslateY(10);
    this.networkVisualisation.update();
    scrollPane.setContent(this.networkVisualisation);

    tabPane.getTabs().addAll(logTab, networkTab);

    final Scene scene = new Scene(tabPane);
    tabPane.prefHeightProperty().bind(scene.heightProperty());
    tabPane.prefWidthProperty().bind(scene.widthProperty());
    return scene;
}
 
開發者ID:RWTH-i5-IDSG,項目名稱:jamocha,代碼行數:28,代碼來源:JamochaGui.java

示例7: DCPlots

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
public DCPlots(DCThreadManager dc) {
        this.dc = dc;
        // tab pane
        final TabPane tabPane = new TabPane();
        tabPane.setSide(Side.TOP);
        tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);

        // charts
        for (JFreeChart lc : this.dc.getPlotter().getAllCharts()) {
            final Tab lcTab = new Tab();
            final StackPane lcSpane = new StackPane();
            lcTab.setText( lc.getTitle().getText() );
            lcTab.setContent(lcSpane);
            // Using java2d in javafx
            // Bind canvas size to stack pane size. 
//            ChartCanvas canvas = new ChartCanvas(lc);
            final SwingNode chartSwingNode = new SwingNode();
            chartSwingNode.setContent(  new ChartPanel(lc) );
            lcSpane.getChildren().add(chartSwingNode);
//            canvas.widthProperty().bind(lcSpane.widthProperty());
//            canvas.heightProperty().bind(lcSpane.heightProperty());
            tabPane.getTabs().add(lcTab);
        }

        final Stage stage = new Stage();
        stage.setTitle("Results");
        //create scene with set width, height and color
        Scene scene = new Scene(tabPane, 1000, 600, Color.WHITESMOKE);
        //set scene to stage
        stage.setScene(scene);
        //center stage on screen
        stage.centerOnScreen();
        //show the stage
        stage.show();
    }
 
開發者ID:fgr1986,項目名稱:maf,代碼行數:36,代碼來源:DCPlots.java

示例8: initComponents

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
public void initComponents()
{
    tabPane = new TabPane();
    tabPane.setSide(Side.LEFT);

    root = new Group();   
    
    novoVeiculoTab = new NovoVeiculoTab();
    listaVeiculoTab = new ListagemVeiculoTab();
    fichaVeiculoTab = new FichaVeiculoTab();
    vendaVeiculoTab = new VendaVeiculoTab();
    aboutTab = new AboutTab();
    
    tabPane.getTabs().addAll(novoVeiculoTab, listaVeiculoTab, 
            fichaVeiculoTab, aboutTab);
    tabPane.getSelectionModel().select(aboutTab);
    
    tabPane.setMinSize(WIDTH, HEIGHT);
    tabPane.setMaxSize(WIDTH, HEIGHT);
    
    /* Mudar */
    t = new BoasVindasNode();
    /* Mudar */
    
    root.getChildren().addAll(tabPane, t);
    root.setAutoSizeChildren(true);
}
 
開發者ID:vfreitas-,項目名稱:ShopCarFX-2.0,代碼行數:28,代碼來源:PrimaryStage.java

示例9: start

import javafx.scene.control.TabPane; //導入方法依賴的package包/類
@Override
public void start(Stage primaryStage) throws Exception {
    
    BorderPane rootPane = new BorderPane();
    rootPane.setId("root");
    
    TabPane rootTabPane = new TabPane();
    rootTabPane.setSide(Side.BOTTOM);
    rootTabPane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
    rootPane.setCenter(rootTabPane);
    
    Controller[] controllers = new Controller[4];
    
    rootTabPane.getSelectionModel().selectedIndexProperty().addListener((o, oldVal, newVal) -> {
        if (oldVal.intValue() >= 0 && controllers[oldVal.intValue()] != null) {
            controllers[oldVal.intValue()].afterHide();
        }
        if (controllers[newVal.intValue()] != null) {
            controllers[newVal.intValue()].beforeShow();
        }
    });
    
    FXMLLoader loader = null;

    loader = new FXMLLoader();
    loader.setLocation(ContractRFXApp.class.getResource("SelectTask.fxml"));
    loader.load();
    SelectTaskController selectTaskController = loader.getController();
    selectTaskController.init(clientModel, taskModel);

    loader = new FXMLLoader();
    loader.setLocation(ContractRFXApp.class.getResource("Work.fxml"));
    Parent workPane = (Parent) loader.load();
    WorkController workController = loader.getController();
    workController.init(taskModel, selectTaskController);
    controllers[0] = workController;
    
    loader = new FXMLLoader();
    loader.setLocation(ContractRFXApp.class.getResource("Clients.fxml"));
    Parent clientsPane = (Parent) loader.load();
    ClientsController clientsController = loader.getController();
    clientsController.init(clientModel);
    controllers[2] = clientsController;

    loader = new FXMLLoader();
    loader.setLocation(ContractRFXApp.class.getResource("Tasks.fxml"));
    Parent tasksPane = (Parent) loader.load();
    TasksController tasksController = loader.getController();
    tasksController.init(clientModel, taskModel);
    controllers[3] = tasksController;

    Font iconFont = Font.loadFont(ContractRFXApp.class.getResource("ionicons.ttf").toExternalForm(), 10);

    Tab workTab = createIconTab(iconFont, '\uf1e1', "Work");
    rootTabPane.getTabs().add(workTab);
    workTab.setContent(workPane);
    
    Tab reportsTab = createIconTab(iconFont, '\uf2b5', "Reports");
    rootTabPane.getTabs().add(reportsTab);

    Tab clientsTab = createIconTab(iconFont, '\uf1bf', "Clients");
    rootTabPane.getTabs().add(clientsTab);
    clientsTab.setContent(clientsPane);

    Tab tasksTab = createIconTab(iconFont, '\uf16c', "Tasks");
    rootTabPane.getTabs().add(tasksTab);
    tasksTab.setContent(tasksPane);
    
    Scene scene = new Scene(rootPane);
    rootTabPane.tabMinWidthProperty().bind(scene.widthProperty().divide(4.0).subtract(5));
    rootTabPane.tabMaxWidthProperty().bind(rootTabPane.tabMinWidthProperty());
    primaryStage.setTitle("ContractR");
    primaryStage.setScene(scene);
    
    primaryStage.show();
}
 
開發者ID:robovm,項目名稱:robovm-samples,代碼行數:77,代碼來源:ContractRFXApp.java


注:本文中的javafx.scene.control.TabPane.setSide方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。