Hello Alexander Warning
                            
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
                            If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.
                         
                     
                                            
                            
                                                                                        
                                Josh Thomas
                                                                                                                                                    Certified Consultant
                                                         
                            
                         
                                                
    
        Please login with a confirmed email address before reporting spam
     
    
 
                                                Posted:
                            
                                1 decade ago                            
                            
                                28 févr. 2013, 17:47 UTC−5                            
                        
                        
                                                    Alex,
Did you ever get the plot while solving to work?
I am newer to using the Java API, but I do have a solution to this (sort of).  Follow these steps:
1)  Add this line to your main method somewhere before any calls to solving:
model.study("std1").feature("time").set("plot", "on");
2)  Add a JButton to the GUI that executes the following commands when clicked:
model.result("pg1").set("window", "window1");
model.result("pg1").run();
Note:  This assumes you already have the plot group "pg1" set up to display in the GUI.
3)  Now, as the simulation proceeds, anytime you click the JButton the plot group results will refresh and show the current results.
There may be a better way to do this.  But, this has worked for me.
Hope that helps some and I would be interested if you have found a different way.
BTW - You seem to be a little more experienced using Java API and Eclipse.  In Eclipse, would you be able to explain to me how to package a JAR file that is easily executed in Windows?  I have only been able to run my API codes through Eclipse thus far.
Best regards,
Josh Thomas
                                                
                                                
                            Alex,
Did you ever get the plot while solving to work?
I am newer to using the Java API, but I do have a solution to this (sort of).  Follow these steps:
1)  Add this line to your main method somewhere before any calls to solving:
model.study("std1").feature("time").set("plot", "on");
2)  Add a JButton to the GUI that executes the following commands when clicked:
model.result("pg1").set("window", "window1");
model.result("pg1").run();
Note:  This assumes you already have the plot group "pg1" set up to display in the GUI.
3)  Now, as the simulation proceeds, anytime you click the JButton the plot group results will refresh and show the current results.
There may be a better way to do this.  But, this has worked for me.
Hope that helps some and I would be interested if you have found a different way.
BTW - You seem to be a little more experienced using Java API and Eclipse.  In Eclipse, would you be able to explain to me how to package a JAR file that is easily executed in Windows?  I have only been able to run my API codes through Eclipse thus far.
Best regards,
Josh Thomas
                        
                                                
                                                                                                            
                                             
                        
                        
                                                
    
        Please login with a confirmed email address before reporting spam
     
    
 
                                                Posted:
                            
                                10 years ago                            
                            
                                24 nov. 2015, 16:25 UTC−5                            
                        
                        
                                                    Hello Josh,
an answer to your question to export a jar file using Eclipse:
File->Export...->Java->JAR file
Follow the instructions and fill out the text boxes as you wish.
Greetings
Michael                                                
                                                
                            Hello Josh,
an answer to your question to export a jar file using Eclipse:
File->Export...->Java->JAR file
Follow the instructions and fill out the text boxes as you wish.
Greetings
Michael