Forums Register Login

launching a batch file

+Pie Number of slices to send: Send
Hi,

By using Netbeans & Swing, I managed to create a window that contains:
-2 uneditable combo boxes
-1 ok button

By clicking on the OK button I would like to be able to :
-close the window
-immediately launch a batch file
-pass the 2 combo boxes' parameters to the batch file

I had never used either Netbeans or Swing. However, I have already developped in Java.

Thanks
+Pie Number of slices to send: Send
Welcome to the Ranch.

Let's break down the problem. Do you know how to "call external programs from Java" (enabling you to call those batch)?

I suspect you used the Netbean's GUI designer to generate Swing code. I highly recommend you code your code GUI code.

For Swing, have you gone over the Swing tutorial here? Have a look at action listeners for the OK button.
+Pie Number of slices to send: Send
After having searched on the net I found this:
Runtime.getRuntime().exec("cmd /c start ...");
where ... is the path to the file to be executed. I tried it and it works. However, I still do not know how to transfer data from a Swing application to a job in Talend. I made changes in the context that were unfortunately fruitless.

Thank you for your reply:)
+Pie Number of slices to send: Send
For Swing combo box, you can check out the tutorials I referred earlier. Just make sure the combo box is "accessible" for the action listener to retrieve the values.
+Pie Number of slices to send: Send
The problem is I'm trying to transfer data from Swing to Talend, not the other way around. I might be mistaken, but I don't think I need action listeners. However, thanks for the reply.
+Pie Number of slices to send: Send
 

Cyril Martin wrote:The problem is I'm trying to transfer data from Swing to Talend, not the other way around. I might be mistaken, but I don't think I need action listeners. However, thanks for the reply.



Ah Don't get me wrong, you are trying to transfer data "from Swing to Talend" (Talend the open source ETL/big data thing). Given you have a button, when you click it, the window closes and get combo box value and submit batch to Talend. Then action listeners are the way to go.

Imagine if action listeners are not used, how are you trigger the batch submission? If there are no listeners attached to the button or there is one but do nothing, then why do you need a button in the first place?
To do a great right, do a little wrong - shakepeare. twisted little ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1440 times.
Similar Threads
Stopping multiple launches of application
Changing NetBeans Style
reseting combo box values
black terminal window springs up before my swing window
Setting an option window
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:45:30.