我对Comsol的Java API有问题。
要绘制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();
}
问题是,当我调用它的构造函数时,它从来没有完成它的执行(“之前”被打印出来,但“之后”从来没有被打印出来,程序仍然在运行)。似乎发生了死锁。我在带有JDK 1.8的Windows1064x上使用Comsol 5.3。
你能告诉我出了什么问题吗?!
发布于 2017-07-04 17:14:45
SwingGraphicsPanel是JPanel在Comsol软件中的一种实现。问题似乎出在Comsol 5.3上。并且它在Comsol 4.4中的实现没有问题。当然,我在它的论坛上没有找到任何报告。
https://stackoverflow.com/questions/44890255
复制相似问题