-2

I have a window with 3 separate JSplitPanes. I've made three of the applications separately; hence they have everything inside of them including things like action listeners.

I've now created a 4th class where I have just called the other classes as objects and put them inside the pane.

Is this complying the MVC standards I should be using? Or do I effectively have to start again and have a different data structure? If so how would you suggest I structure it? Have all the 'layout' stuff in one class, all the 'data structure' stuff in another and one more with all the 'calculations' hence stuff like the action listeners?

Ramzi Khahil
  • 4,932
  • 4
  • 35
  • 69
Jay
  • 2,107
  • 4
  • 20
  • 24
  • 1
    this is way too vague/broad a question, as such not really answerable – kleopatra Nov 25 '12 at 14:35
  • Please edit your question to include an [sscce](http://sscce.org/) that exhibits the problem you describe. For reference, see this [example](http://stackoverflow.com/a/3072979/230513), and try to narrow the focus of your question. – trashgod Nov 25 '12 at 14:46

1 Answers1

2

I didn't really understand what you did, but here is a simple way you can check it yourself:

  • Are the swing components only reflecting the data, and not holding it?
  • Do you have a class that handles data (and only data)?
  • Do you have a class that handles the logic?

Your answers should be yes to all questions.

In case you have logic in a listener method, you are doing it wrong. In case you ask a visual object to get data, you are doing it wrong.

How you organize the panes, and to make it look good is not relevant.

Ramzi Khahil
  • 4,932
  • 4
  • 35
  • 69