Results 1 to 2 of 2
Thread: how to inherit a customised
- 04-12-2009, 03:15 AM #1
Member
- Join Date
- Apr 2009
- Posts
- 1
- Rep Power
- 0
how to inherit a customised
Dear all,
I'm using NetBean IDE 6.5.1 to try out my very 1st Java lesson. I have created a new class from JFrame.
Java Code:public class stdscreen extends JFrame implements ActionListener{} .. adding a exit button to serve as template for all child form in the future.
Later, try to inherit this class "stdscreen" and this is where the problem comes in.
Attempted Approach #1
Save the class "stdscreen" as template and create a new class based on this template (shown in attachment).
Result : The child class contains all the codes in the parent class. :mad:
Attempted Approach #2
Create the new child class by inherit the JFrame class and substitute the JFrame keyword to stdscreen.
Result : I have a blank JFrame screen and my Exit button is not visible until i run the program.
Question :
1) How to make the class stdscreen as parent class while visually able to see its inherited objects during design mode so that i can expand things i need in the child class ?
Thank you.
-
You'll likely find that most of the Swing experts here (and some non-experts like me), don't use NetBeans-generated code to create their GUIs. If you don't get decent help here in a short period of time, you may want to ask this in a NetBeans forum where there are likely to be more netbeans experts. If you do this though, please place a link in both threads, one to the other. Good luck.


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks