Integrating batch script into Java GUI? -
This question is also asked by me:
As I do not have the appropriate answer for my question That is why I decided to ask again in the stack overflow again in another short and sweet manner. Disclaimer: I have edited the question in that site, this is the reason why I could not find the appropriate answer for my question.
I have this batch script which should be integrated into Java coding. But this is the first time that I am unifying so I do not know how it should be done.
It would be nice if someone could answer my question on that site. But if you are not, then it would be nice to provide an example of integrating multiple selection batch scripts in Java. Email through your original post, I can conclude that your solution will be quite simple:
private static string cmdline = ""; personal stabilized Last string scripfile = "MYSCRIPT.sh" public GUI () {setTitle ("family"); setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); setbound (100, 100, 450, 300); ContentPane = new zpnic (); ContentPane.setBorder ( New blank border (5, 5, 5, 5)) setContentPane (contentPane); ContentPane.setLayout (zero); JCheckBox chckbxMyFatherIs = New JCheckBox ("My Father Is"); ChckbxMyFatherIs.addActionLis Tener (new exclamationist) {PublicExactedExvolution (ActionEvent arg0) {if (! CmdLine.contains ("JOE")) cmdLine + = "JOE";}}); ChckbxMyFatherIs.setBounds (45, 48, 137, 23) ); ContentPane.add (chckbxMyFatherIs); Junkbox Chuckx Newcacksbox = New Junkbox ("My Mom is Audrey"); ChckbxNewCheckBox.addActionListener {New ActionListener} {ActionEvent E. {{(CmdLine.contains (" AUDREY ")) cmdLine + =" AUDREY ";}}); ChckbxNewCheckBox.setBounds (196, 48, 98, 23); ContentPane.add (chckbxNewCheckBox); Junk Box Chuck's New Chefs Box = New Junkbox ("My beer is Jerry"); ChckbxNewCheckBox_1.addActionListener (New ActionListener) {Public Actions executed (ActionEvent E) {if (! CmdLine.contains ("JERRY")) cmdLine + = "JERRY";}}; ChckbxNewCheckBox_1.setBounds (45, 97, 137, 23); ContentPane.add (chckbxNewCheckBox_1); JCheckBox chckbxNewCheckBox_2 = New JCheckBox ("My biggest sister is June"); ChckbxNewCheckBox_2.addActionListener (new executable () {executed public zero verb} {if (! CmdLine.contains ("JUNE")) cmdLine + = "JUNE";}}); ChckbxNewCheckBox_2.setBounds (1996, 97, 1989, 23); ContentPane.add (chckbxNewCheckBox_2); JCheckBox chckbxNewCheckBox_3 = New JCheckBox ("My little sister is Awy"); ChckbxNewCheckBox_3.addActionListener (new executable () {executable public action} (ActionEvent E) {if (! CmdLine.contains ("AWY")) cmdLine + = "AWY";}}); ChckbxNewCheckBox_3.setBounds (196, 14 9, 1989, 23); ContentPane.add (chckbxNewCheckBox_3); Junkbox Wheel x All = New Junkbox ("All"); ChckbxAll.addActionListener (new executable () {Public Zero Action Perffered (Action Event e) {CMDline = "Joy Audrey Jerry Jane Ave"}}}); ChckbxAll.setBounds (45, 14, 9, 97, 23); ContentPane.add (chckbxAll); }
You will also need an Event-listener for your OK-Button, in which you can call:
Runtime.GetReight (). Exec (scriptfile + CMDline);
You note: it only adds parameters to your list, also need to tuck the box (without the exit) ... I think now that you know that how. Consider using a single string instead ... it is less messy and allows for extra for dynamic lookup / removal / parameters.
Comments
Post a Comment