Two Laptop Bag*
The moose likes Ant, Maven and Other Build Tools and the fly likes Updates to Java GUI when Running UNIX Shell Script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Updates to Java GUI when Running UNIX Shell Script" Watch "Updates to Java GUI when Running UNIX Shell Script" New topic
Author

Updates to Java GUI when Running UNIX Shell Script

Manuel Farias Hernandez
Greenhorn

Joined: Jul 07, 2004
Posts: 8
I am writing a kind of install wizard, that I have named JInstall. This JInstall calls a UNIX shell script named install. This script, is the real installation program, and my JInstall is just a nice front end that gathers settings from the user, presents the License.txt file, etc. My JInstall extends JFrame, and uses several JPanels together with a CardLayout Manager to handle the different pages that the user has to go through, for example, a License Agreement Page, Directory Selection Page, and so on.

In the Install Page, I want to display the output from the install shell script in a JTextArea. My problem is that, the output from the shell script install is not simultaneously displayed as the install script runs. All the output is displayed when the script ends, and the scripts takes 1 - 2 minutes to run. Thus, my Java application seams to hang when the user clicks the Install button (a JButton ...).

Please note that my call of the install shell script, is done through the following steps:

runInstallShellScript() {
cardLayout.show( cardPanel, "Install" );
SwingUtilities.invokeLater( this ); // To let the GUI be updated.
}

public void run() {
// Run the install script
}

The use of SwingUtilities.invokeLater is needed, as previously, the updates to the GUI did hang while the install script run. Now, the Install Page is displayed, and then starts the shell script.

So, thus somebody know what I should do? Maybe, there is a complete different approach to have when creating Java-GUI-shell-script-application.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updates to Java GUI when Running UNIX Shell Script
 
Similar Threads
FTP
Applets and shell scripts
Updates to Java GUI when Running UNIX Shell Script
Install Linux application using Java
Updates to Java GUI when Running UNIX Shell Script