tags:

views:

91

answers:

4

My problem is the following: I have a Java application, and I would like to create a setup form on it, so i can declare some variables.

How can it be done? And when the setup form is on focus, it should be disabled to perform actions on the main form.

Thanks for any help.

hectai

+1  A: 

You have wide choice :

1- Java Makefile

2- Setup Maker 1.0

3- I recommended : JSmooth

SjB
sorry, my bad, its not setup form but an 'options' form, where the user could modify up values of my variables.
Hectai
+1  A: 

Use swing. When you press "Save" you store the global variables of your app. If you wanna you can show this form at the start of your app.

tommaso
+2  A: 

Create a JDialog and fill it the controls required to display/change options. One of the JDialog constructors accepts a boolean argument that tells the dialog to be modal, meaning that the user will be unable to focus on the main form.

If you are using AWT, use Dialog instead of JDialog.

jassuncao
thanks, i'm going with that one :)
Hectai
A: 

As jassuncao posted - you're looking for a JDialog to present this to the user. I'd also suggest using the Java Preferences API over setting variables directly. Preferences has support for saving values between runs, using defaults if no value is provided, etc.

Nate