Forums Register Login

An inheriting question

+Pie Number of slices to send: Send
I have a class which I extend in a two other class. That main-class has three panel and two of them would be same in those child-class but one panel should be modified. I just dont know how to make this happen :|

That doesnt work and I need some help.
Thanks in advance
+Pie Number of slices to send: Send
hi,
I wouldn't subclass JFrame but rather composition. That is:
The main frame uses internally three JPanels. Two of these panels stay always the same. The third panel can be in different states. I don't know what factors affect the state of this panel but maybe you can use some method of constructor argument to control the behaviour of this panel.
Maybe you want to describe the intended behaviour of your gui more closely?
Chantal
+Pie Number of slices to send: Send
sorry for posting again, but my first sentence was a bit messy. I mean:
I prefer composition to inheritance.
(And for what I know composition points most of the time to the more object oriented solution.)
C
+Pie Number of slices to send: Send
Well, the idea is basically something like this:
I have login window and if login was succesfully main window will open. There is on top of login window and main window some "title panel" which has always the same look (that is diveded in two panels). Hope this cleared a little bit?
+Pie Number of slices to send: Send
ok, now I see what you mean.
If you want to use inheritance maybe this sample code helps you:

cheers
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 734 times.
Similar Threads
Components size
jpanel paint image using method like jpanel1.paint
question about polymorphism
BackgroundPanel.java cannot be placed in BorderLayout.NORTH
Help with two buttons on applet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:10:20.