csad Posted May 31, 2011 Posted May 31, 2011 Hi, I like to call call the "actionPerformed" of the button a FileMaker script in the following code This does not work! What am I doing wrong? Thanks for your help CODE: import javax.swing.*; import java.awt.event.*; new FensterWegImplementsAll(); class FensterWegImplementsAll extends JFrame implements WindowListener, ActionListener { public FensterWegImplementsAll() { setLayout(null); setSize( 400, 400 ); addWindowListener( this ); setVisible( true ); JButton btn_1 = new JButton("TOC"); btn_1.setBounds(10,10,100,25); btn_1.addActionListener(this); add(btn_1); } public void windowClosing( WindowEvent event ) { dispose(); } public void windowClosed( WindowEvent event ) {} public void windowDeiconified( WindowEvent event ) {} public void windowIconified( WindowEvent event ) {} public void windowActivated( WindowEvent event ) {} public void windowDeactivated( WindowEvent event ) {} public void windowOpened( WindowEvent event ) {} public void actionPerformed(ActionEvent event) { fmpro.performScript("ScriptMaster","TOC",""); } }
dansmith65 Posted June 3, 2011 Posted June 3, 2011 I believe your problem is the fmpro object does not exist in the scope of your class. You can pass the fmpro object to your FensterWegImplementsAll object when you create it; then the actionPerformed method needs to use the fmpro object that was passed into your class.
csad Posted June 6, 2011 Author Posted June 6, 2011 I believe your problem is the fmpro object does not exist in the scope of your class. You can pass the fmpro object to your FensterWegImplementsAll object when you create it; then the actionPerformed method needs to use the fmpro object that was passed into your class. Thanks it functions. But now i have the same problem like in this Thread: http://fmforums.com/forum/topic/74209-fmpro-object-taking-a-long-time-to-respond/ The fmpro Objekt d'ont respond regulary! Did you have a solution for this problem? Thank you very much!
dansmith65 Posted June 7, 2011 Posted June 7, 2011 I am using the fmpro object similar to how I suggested in my last post, except that I compiled my code into a jar file. I haven't had any problems like mentioned in the post you linked to.
csad Posted June 8, 2011 Author Posted June 8, 2011 Hello dansmith65, thanks for your answer. I compilet my code / class in a Jar-File as you sad. In Filemaker i just use the following call to make an instanse of my class: CFMMenue fen = new CFMMenue(fmpro); and i have the same problem! Filemaker d'ont respond sometimes and sometimes takes a lot of time bevore executing the called Filemaker-Script. Did you an idea about this problem? or another solution? The background is to make a bether dynamic navigation of our filemaker solution (f.e.: with JTree). Thanks for your help !
dansmith65 Posted June 10, 2011 Posted June 10, 2011 I hadn't connected it before, but I think I actually did experience a similar issue. I was able to resolve it by setting thread priority: http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Thread.html With default priority (6), the process I was running could be delayed by a half hour or more when FileMaker was not the active window. When FileMaker was active, it typically responded with little delay. Try setting it to 9 and see if that works for you.
csad Posted June 16, 2011 Author Posted June 16, 2011 I hadn't connected it before, but I think I actually did experience a similar issue. I was able to resolve it by setting thread priority: http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Thread.html With default priority (6), the process I was running could be delayed by a half hour or more when FileMaker was not the active window. When FileMaker was active, it typically responded with little delay. Try setting it to 9 and see if that works for you. I used a Thread und set the priority with different values. But i habe always the same problem another idea ? thanks!
IT Heroes Posted June 22, 2011 Posted June 22, 2011 Have you tried Filemaker 11 ?. Maybe it works properly in that. Or maybe try not invoking from the EDT, so run it from a new Thread? I dunno, I haven't solved it yet. I reckon what would be super cool too would be if you embed your JTree into a filemaker container rather than as a separate window...
csad Posted July 6, 2011 Author Posted July 6, 2011 Have you tried Filemaker 11 ?. Maybe it works properly in that. Or maybe try not invoking from the EDT, so run it from a new Thread? I dunno, I haven't solved it yet. I reckon what would be super cool too would be if you embed your JTree into a filemaker container rather than as a separate window... i tried with Filemaker 11 and had the same problem. But now i know the problem :-) I was working with a Window 64 Bit version and that was the problem! With Windows 32 Bit it is working just fine :-) Your idea with the FM container is nice too, i will try it. Thansks!
andries Posted July 6, 2011 Posted July 6, 2011 I reckon what would be super cool too would be if you embed your JTree into a filemaker container rather than as a separate window... Did someone succeed in this? As I can see from the documentation of ScriptMaster this would mean we would need to create some kind of FM Object or a File, all the other types would return or a simple String, Image or Number.
IT Heroes Posted July 6, 2011 Posted July 6, 2011 Did someone succeed in this? As I can see from the documentation of ScriptMaster this would mean we would need to create some kind of FM Object or a File, all the other types would return or a simple String, Image or Number. It isn't possible as far as I know... but it would be cool if it was possible . The only way I thought of doing it was loading an applet in a web viewer... but then there are probably a million problems with that . I've tried tracking the windows in filemaker and then rendering a frameless window over the top, but that also proved too complicated .
Recommended Posts
This topic is 4901 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now