javafx.embed.swing.JFXPanel.setPreferredSize()方法的使用及代码示例

x33g5p2x  于9个月前 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(12)

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

JFXPanel.setPreferredSize介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/simulation-construction-set-test

private void createJFrame()
{
 JFrame jFrame = new JFrame();
 heatmapGraph = new JavaFXHeatmapGraph(registry, graphIndicesHolder, selectedVariableHolder, dataBuffer, dataBuffer);
 heatmapGraph.setXVariable(x);
 heatmapGraph.setYVariable(y);
 heatmapGraph.getPanel().setPreferredSize(new Dimension(480, 200));
 jFrame.add(heatmapGraph.getPanel());
 jFrame.pack();
 jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 jFrame.setLocationRelativeTo(null);
 jFrame.setVisible(true);
}

代码示例来源:origin: eu.agrosense.client/worker

public NewWorkerView(PresentationModel model) {
  Validate.notNull(model);
  setLayout(new BorderLayout());
  fxPanel = new JFXPanel();
  //Scene dimensions not used by Dialog as it is created later, set on fxPanel as well:
  fxPanel.setPreferredSize(new Dimension(SCENE_WIDTH, SCENE_HEIGHT));
  Platform.setImplicitExit(false);
  // create JavaFX scene
  Platform.runLater(new SceneInitializer(model));
  add(fxPanel, BorderLayout.CENTER);
}

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

panel.setPreferredSize(imageSize.getSize());

代码示例来源:origin: eu.agrosense.spi/session

private void initComponents() {
  setLayout(new BorderLayout());
  fxPanel = new JFXPanel();
  //Scene dimensions not used by Dialog as it is created later, set on fxPanel as well:
  fxPanel.setPreferredSize(new Dimension(SCENE_WIDTH, SCENE_HEIGHT));
  Platform.setImplicitExit(false);
  // create JavaFX scene
  Platform.runLater(new Runnable() {
    @Override
    public void run() {
      final Scene scene = new Scene(new Browser(rootCallback), 750, 500, Color.web("#666970"));
      fxPanel.setScene(scene);
    }
  });
  add(fxPanel, BorderLayout.CENTER);
}

代码示例来源:origin: eu.agrosense.client/util-javafx

private void initComponents(final CrudPane.Factory factory) {
  setLayout(new BorderLayout());
  fxPanel = new JFXPanel();
  //Scene dimensions not used by Dialog as it is created later, set on fxPanel as well:
  fxPanel.setPreferredSize(new Dimension(SCENE_WIDTH, SCENE_HEIGHT));
  Platform.setImplicitExit(false);
  Platform.runLater(new Runnable() {
    @Override
    public void run() {
      CrudPane root = factory.create(model);
      Scene scene = new Scene(root, SCENE_WIDTH, SCENE_HEIGHT);
      StyleManager.Default.applyFormStyle(scene);
      fxPanel.setScene(scene);
    }
  });
  add(fxPanel, BorderLayout.CENTER);
}

代码示例来源:origin: eu.agrosense.spi/session

private void initComponents() {
  setLayout(new BorderLayout());
  fxPanel = new JFXPanel();
  //Scene dimensions not used by Dialog as it is created later, set on fxPanel as well:
  fxPanel.setPreferredSize(new Dimension(SCENE_WIDTH, SCENE_HEIGHT));
  Platform.setImplicitExit(false);
  // create JavaFX scene
  Platform.runLater(new Runnable() {
    @Override
    public void run() {
      try {
        FXMLLoader loader = new FXMLLoader(getClass().getResource("Login.fxml"));
        loader.setController(controller);
        Parent root = (Parent) loader.load();
        Scene scene = new Scene(root);
        fxPanel.setScene(scene);
      } catch (IOException ex) {
        Exceptions.printStackTrace(ex);
      }
    }
  });
  add(fxPanel, BorderLayout.CENTER);
}

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

JFXPanel dlgContent = new JFXPanel();
dlgContent.setScene(scene);
dlgContent.setPreferredSize(new Dimension(200, 200));
dlgContent.setVisible(true);

代码示例来源:origin: eu.agrosense.client/field

fxPanel = new JFXPanel();
fxPanel.setPreferredSize(new Dimension(SCENE_WIDTH, SCENE_HEIGHT));

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

jfxPanel.setPreferredSize(new Dimension(600, 600));

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

final JComponent component(final int index) {
  if (p == null) {
    p = new JFXPanel();
    p.setPreferredSize(new Dimension(500, 340));
    p.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true);
    p.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true);

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

public void init() {
  fxContainer = new JFXPanel();
  fxContainer.setPreferredSize(new Dimension(JFXPANEL_WIDTH_INT / 5, JFXPANEL_HEIGHT_INT / 5));
  add(fxContainer, BorderLayout.NORTH);
  fxContainerTwo = new JFXPanel();
  fxContainerTwo.setPreferredSize(new Dimension(JFXPANEL_WIDTH_INT, JFXPANEL_HEIGHT_INT));
  add(fxContainerTwo, BorderLayout.CENTER);
  Platform.runLater(new Runnable() {

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

public void init() {
  fxContainer = new JFXPanel();
  fxContainer.setPreferredSize(new Dimension(WIDTH / 5, HEIGHT / 5));
  add(fxContainer, BorderLayout.NORTH);
  fxContainerTwo = new JFXPanel();
  fxContainerTwo.setPreferredSize(new Dimension(WIDTH, HEIGHT));
  add(fxContainerTwo, BorderLayout.CENTER);
  Platform.runLater(new Runnable() {

相关文章