Hi all

Is it possible to use only the classes you need in a panel or something? I'm finding it hard to explain my question, i'll give an example:
We need to make a program to organise swimming competitions. When you want to (as a user) edit or create a new event, the GUI needs to work with the Event class and it's related classes.
But when the user only wants to create or edit a swimming pool, the GUI only needs to work with the SwimmingPool class.

Is it possible, when you create panels for each action (like "creating an event", "editing a swimming pool"), to only include the classes you need for the action (for example, only the SwimmingPool class) in the JPanel, without having them all in the GUI class.

Thx in advance
Greets, Kenny.

PS: If it's not clear yet, please tell me

Just create two separated classes that extends JPanel add necessary components as need it. Then display them depending on selected action in your JFrame.

Ok, thank you :)
I'll be trying that out ;)


Great post dude, I can increase my knowledge.

Great post dude, I can increase my knowledge.

Now you either

  • Mocking the answer
  • You serious
  • You posting to just flash your signatures