2017-07-03 26 views
-1

我有Comsol的Java API问题。Comsol,java API,SwingGraphicsPanel从未完成

要绘制COMSOL模型的结果,我要创建com.comsol.modelguiswing.SwingGraphicsPanel

这里的一个实例是我的代码:

public void start() { 
    frame = new JFrame("Beam GUI - based on COMSOL Multiphysics"); 
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
    frame.setSize(1000, 730); 
    JPanel mainPanel = new JPanel(); 
    frame.getContentPane().add(mainPanel); 
    mainPanel.setLayout(new BorderLayout()); 
    SwingGraphicsPanel.getDefaultLocale(); 

    System.out.println("before"); 
    final SwingGraphicsPanel graphicsPanel 
      = new SwingGraphicsPanel("window1", "Window1"); 
    System.out.println("after"); 

    mainPanel.add(graphicsPanel, BorderLayout.CENTER); 
    frame.setVisible(true); 
    model = BeamModel.run(); 
    model.sol("sol1").runAll(); 
    model.result("pg1").set("window", "window1"); 
    model.result("pg1").run(); 

} 

的问题是,当我把它构造函数,它从来没有完成它的执行(“之前”被打印,但“之后”从未打印和程序仍在运行)。似乎发生了一场僵局。我在Windows 10 64x和JDK 1.8上使用Comsol 5.3。

请您告诉我是什么问题?

+0

因此,从您的帖子中,我们可以告诉您的是,您在代码中遇到了问题,您没有向我们展示 - SwingGraphicsPanel构造函数。 –

+2

请考虑发布有效的[mcve],以便我们实际测试并查看问题所在。 –

+0

............你好? –

回答

0

SwingGraphicsPanel是Comsol软件中的JPanel实现。看来问题出在Comsol 5.3上。它在Comsol 4.4中的实现没有问题。 当然,我在论坛上没有找到任何报道。