2

I have written a simple Command-Line programm that disolves car license plates. like:

  • V -> Vienna
  • la -> Los Angeles

Now I want to make a simple GUI (its my first gui) for that programm. here're my classes:

Dissolver.java // dissolves car plates ; and contains whole logic

DissolverGUI.java // gui for Dissolver

My problem is: where should I create my object of Dissolver in the DissolverGui class?

I hope you are able to understand my problem

1
  • 1
    Your plan to separate GUI from logic is a noble one. Consider creating your Dissolver in the main method and passing it into the GUI via either a setDisolver(Dissolver dissolver) method or via a constructor parameter. Commented Dec 30, 2012 at 15:03

1 Answer 1

3

Your question is too broad. It's hard to give an advice without seeing the code. You can try adding a field in DissolverGui class referencing Dissolver and use it from all methods. Suppose the right place to create it is the public static void main(String[]) method which will run the whole program.

As a beginner do not bother yourself about the style, just make the program work as you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.