Inheriting a Class that inherits a JFrame.. how????

Hi to all!!!
i would like to ask about the LOGIC on how to inherit a CLASS that inherits a JFrame??? for example, i've created a Class that extends a JFrame called "MotherFrame.class". I also want to create another class called "ChildFrame.class" that will extend "MotherFrame.class" and i want ChildFrame to add another button for a specific functionality... my point is i want all the Functionality in "MotherFrame" will be inherit by "ChildFrame" BUT "ChildFrame" will have an added functionality. Like "MotherFrame" has 5 buttons and i wand "ChildFrame" inherit those 5 buttons But also i will add another button to "ChildFrame" that will make it 6 buttons.. how will i do that??? any LOGICAL explanations or CODE SAMPLE will be BEST??
tnx in advance???

class myRootClass{
  myRootClass{
    super();
/what ever code
class myLevelOneClass extends myRootClass{
  myLevelOneClass{
    super();
/what ever you want more than in myRootClass
class myLevelTwoClass extends myLevelOnceClass{
  myLevelTwoClass{
    super();
/what ever you want more than in myRootClass and myLevelOneClass
/and so forth

Similar Messages

  • Overloading constructor of a child that inherits from a class that inherits from Windows.Forms

    The title might be a bit confusing so here is the layout.
    - classHForm inherits System.Windows.Forms.Form
    - frmDoStuff inherits classHForm  (written by someone else and used in several applications)
      - does not have a constructor specifically defined, so I added the following thinking it would override the parent
    Sub Public New()
    End Sub
    Sub Public New(byval data as string)
    'do stuff
    End Sub
    In my code, I want to instantiate frmDoStuff, but I need to overload it's constructor and populate fields within this form. The problem I'm running into is that when I run this, it is using the constructor from classHForm and ignores any constructor in frmDoStuff.
    I guess you can't override the parent constructor? Is that why it won't work?
    I didn't want to overload the classHForm constructor, but I will if that's the way to go.
    my code:
    dim frm as new frmDoStuff(myString)
    Note: I would love to show actual code, but not allowed. Against company rules.

    Your code is similar. The value I pass into frmDoStuff is supposed to set a value for a textfield.
    Public Class frmDoStuff
    Inherits classHForm
    Public Sub New(ByVal s As String, ByVal gridData() as String)
    txtMyTextField.text = s LoadGrid(gridData)
    End Sub
    I also have a datagridview I need to populate in frmDoStuff and thought I would have another string or string array as a second parameter to the constructor and then call a routine from the constructor to populate the datagrid.
    of course, when I run it this way, the code is not being reached. I'll build an example as COR suggested and maybe someone will see where I'm going wrong.
    [UPDATE]
    I created a simple example and it worked. So, now I need to try to understand what is different in the actual code.
    Here is my example:
    Parent Class inherits form
    Imports System.Windows.Forms
    Public Class classMyForm
    Inherits System.Windows.Forms.Form
    Sub New()
    ' This call is required by the designer.
    InitializeComponent()
    ' Add any initialization after the InitializeComponent() call.
    End Sub
    End Class
    Public Class frmDoStuff
    Inherits classMyForm
    Public Sub New()
    ' This call is required by the designer.
    InitializeComponent()
    ' Add any initialization after the InitializeComponent() call.
    End Sub
    Public Sub New(ByVal sStuff As String)
    MyBase.New()
    InitializeComponent()
    'Populate the textbox
    TextBox1.Text = sStuff
    End Sub
    End Class
    Public Class frmMyForm
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim frm As New frmDoStuff(TextBox1.Text)
    frm.Show()
    End Sub
    End Class
    Just to recap. The actual parent was created a few years ago and the child form that I'm calling, "frmDoStuff" was created a couple years back and is used in several applications. I need to use it in my application, but I need to populate a couple
    controls when the form is loaded. As you can see in this example, I successfully overloaded the constructor to populate the textbox in frmDoStuff.
    In my real life situation, my overloaded constructor seems to be getting ignored when i step through the code. I'll go back and do some more testing.

  • If java inherites Object , and i inherite another class  how possible ?

    hey !
    if my class B inherits A , and you know that all class inherits a class called Object , then that means B inherts two classes one A (user defined ) and another Object, then is it a violation of rule ? if now how java achieved this feature ? can you justify
    for sack of simplicity i wrote following code .
    class B extends A
    int r;
    B(int a)
    r=a;
    public String toString()
    return r +" ";
    }

    Java supports this:
       Object
          |
          A
          |
          B
          |
          Cbut not this:
       Object
       A     B
          C

  • About classes and Inheritance

    hi every one,
    i want use class with object in data block and i want know how i can use inheritance with objects.
    becouse i have interview in this two subjects, can any body support my.
    thanks,,,,,,,

    Hello,
    Start Forms Builder, the press F1 to display the online help.
    In the search tab, you can type "Class Property" or "Object Library" to find documentation on those topics:
    About Property Classes A property class is a named object that contains a list of properties and their settings. Once you create a property class you can base other objects on it. An object based on a property class can inherit the setting of any property in the class that makes sense for that object. Property class inheritance is an instance of subclassing. Conceptually, you can consider a property class as a universal subclassing parent. There can be any number of properties in a property class, and the properties in a class can apply to different types of objects. For example, a property class might contain some properties that are common to all types of items, some that apply only to text items, and some that apply only to check boxes. When you base an object on a property class, you have complete control over which properties the object should inherit from the class, and which should be overridden locally. Property classes are separate objects, and, as such, can be copied between modules as needed. Perhaps more importantly, property classes can be subclassed in any number of modules.
    or
    Using the Object Library These topics contain information about using the Object Library in Oracle Forms: About the Object Library Removing an Object from the Object Library Creating a tab in the Object Library Deleting a Tab in the Object Library Saving an Object in the Object Library Opening an Object Library Module Displaying the Object Library Closing the Object Library Commenting Objects in the Object Library
    Francois

  • Custom Inherited/Derived Class & the Data Warehouse

    Hi there,
    I'd like to reference an older post by Travis in regards to getting a Custom Class into the Dataware House:
    DW Reporting on Custom Class
    Scenario:
    I've created an Inherited/Derived Class, with its own Form (not an
    Extension).
    This Class Inherits from the Base Incident Class.
    Inherited Class has two (2) new properties (a String and a List Property).
    Class and Form is all working well within the SCSM Console.
    By default, this class is inheriting all the Relationships (like AssignedTo, AffectedUser, CreatedBy, HasConfigItem) from the Base Incident Class without me having to do anything in the mp apart from including the <Reference> & <TypeProjection>
    components.
    To get this class I am aware that it has
    to be defined - as in a new dimension has to be created for this Derived Class.
    Questions:
    1. Is it recommended to have these dimension/s in a separate sealed mp, or include it with the derived Class mp (sealed) - is there a best practice?
    2. Online resources (technet and other) state a dimension has to be created for the new Class <Dimensions>, but do I also need to include <Outriggers> as well as <Facts>
    for this Class?

    In JDeveloper 10.1.2, I configure in adfjclient_binding.xml:
    <controlDefinition name="JTable Ext"
    className="com.lib.swing.JTableExt"
    classPath=""
    shortLabel="JTableExt"
    longLabel="com.lib.swing.JTableExt"
    tooltipText="com.lib.swing.JTableExt"
    bindingType="DCTable"
    icon="/oracle/ideimpl/resource/images/palette/JTable.gif">
    <useTemplate>
    <![CDATA[${FieldName}.setBinding(panelBinding,"${BindingName}","${IteratorBinding.getId()}")]]>
    </useTemplate>
    <imports>
    <![CDATA[javax.swing.JTable;javax.swing.table.TableModel;com.lib.swing.JTableExt]]>
    </imports>
    </controlDefinition>
    and In my projects, I only drag and drop JTableExt into my form, it auto generate code:
    jTableExt1.setBinding(panelBinding, "SubProfileTypeView2", "SubProfileTypeView1Iterator");
    because setBinding function of JTableExt in my library, it contains setmodel function and some other function.
    Now, In JDeveloper 10.1.3, I drag and drop JTableExt into my form and I have to code one line:
    jTableExt1.setBinding(panelBinding, "SubProfileTypeView2", "SubProfileTypeView1Iterator");
    Which way is there, I haven't to code?
    Jacque

  • Syntax Error "Method was not declared or inherited in class"

    Dear all,
    I am seeing the following syntax error in one of the standard classes CL_ICCMP_BT_INRHISTRESULT_CN01 which says "Method "XYZ" was not declared or inherited in class". Need help to identify when this error would occur or where I should be checking for this error within the class.
    I checked other systems for the same class, the method XYZ does not exist there too but still the class has no syntax errors!
    Would appreciate your help!
    Thank you.
    Regards,
    Gayathri.

    Hi Gayathri,
    please give detailed information on how and where you get this error.
    CL_ICCMP_BT_INRHISTRESULT_CN01 does not exist in our ECC600 system.
    Regards,
    Clemens

  • AS3.0: How to extend a class that extends MovieClip

    When I try to set the base class of a library symbol to a
    class that doesn't DIRECTLY extend MovieClip, but instead extends
    another class that DOES extend MovieClip, it's disallowed, saying,
    "The class 'Whatever' must subclass 'flash.display.MovieClip' since
    it is linked..."
    Is this just a validation bug in the property windows, only
    checking one class deep into the inheritance hierarchy? Because the
    specified class does extend MovieClip, just two levels in instead
    of one. Is there a fix for this? Or must library symbols always
    directly extend MovieClip? If so, why?

    Which classes from flash.display have you imported. Just
    because a class extends another doesn't mean that it inherits all
    of its properties. Saying a class extends sprite doesn't give you
    access to all of it's properties, members and display unless you
    first import flash.display.* or flash.display.Sprite. If you aren't
    already importing flash.display.*, try importing
    flash.display.MovieClip and see what happens...

  • Abstract classes and inheritance

    I'm trying to do some simple inheritance but I'm a little stuck. Without giving too much away here's what I have (or am trying to have). I have an abstract "Test" class and a number of concrete classes that extend that abstract class. In my main method I have an array of Test objects. Each object in the array is a certain kind of "Test" and each one has its own way of doing most things but it doesn't make sense to have just a plain Test object because it is an abstraction. In my code I go through the array and execute a method, runTest(), for each Test in the array. However, my abstract Test class doesn't have a runTest() method b/c it will never get used and java complains. At runtime shouldn't java figure out, OK this is TestA, so go to TestA's runTest method (polymorphism?). What should I put in my runTest method in the abstract class? I know I can put anything there but what is standard?

    JFactor2004 wrote:
    ... Each object in the array is a certain kind of "Test" and each one has its own way of doing most things but it doesn't make sense to have just a plain Test object because it is an abstraction. In my code I go through the array and execute a method, runTest(), for each Test in the array. However, my abstract Test class doesn't have a runTest() method b/c it will never get used and java complains. If you want to instantiate the Test class
    you need to provide an implementation for the runTest() method,
    something like/*type*/ runTest() { throw new UnsupportedOperationException(); }

  • ERROR: RUL-00025:fact class multiple inheritance not supported

    I am receiving this erro message when trying to invoke a rule (assert, execute ruleset,retrieve results) on a XML Fact structure that has demo element as parent with a ref to two child elements: invoice and po.
    I simply used the wizards to deploy the decide activity so I have no clue what this might be.
    The rule session EVALUATEAPPROVAL:230011 failed to execute step assert
    RUL-00025:fact class multiple inheritance not supported
    oracle.rules.rl.exceptions.RLRuntimeException: fact class multiple inheritance not supported
         at oracle.rules.rl.exceptions.ExceptionFactory.createRuntimeMultipleInheritanceException(ExceptionFactory.java:467)
         at jess.DefinstanceList.autoDefclass(DefinstanceList.java:996)
         at jess.DefinstanceList.assertObject(DefinstanceList.java:570)
         at jess.Rete.assertObject(Rete.java:1557)

    RL only supports single inheritance, either from an interface or a class. JAXB 1.0 generates a set of classes that inherit and implement each other. If the RL code is generated in the wrong order and child classes are generated before parent classes, then you get the indicated exception. In most cases, not importing the element class will prevent this from happening, and in the rest not importing the ObjectFactory class will prevent it (or unchecking the "supportsXpath" option). You can't use the element class in the rules anyway since the properties it inherits from it's parent don't show up in lists.
    So, it's not the complexity of the XSD that matters in processing, only that a single inheritance chain is specified. If you follow the original instructions with your complex XSD, I believe you will see it work correctly.
    This has been fixed in the as-yet-unreleased 10.1.3.4 version, but the only workaround for released versions is above.

  • Static Inheritance, Constructors --- Classes as objects

    First I asked myself why constructors are not inherited.
    Then I asked myself why Static Methods are not inherited.
    And it all seems to come down to, why Classes are not objects in Java as they are in Smalltalk?
    Is there any reason I'm missing?
    I would love at least inheritable static methods.

    That's OK, but that method would not be inherited, and would execute in the context of the superclass.
    Picture this (a simple "template method"):
    class SuperClass {
         public static void staticMethod() {          
              System.out.println("Static in SuperClass");
              other();          
         public static void other() {          
              System.out.println("other in SuperClass");
    class SubClass extends SuperClass{
         public static void other () {
              System.out.println("other in SubClass");
    Here, I just want to redefine other() in SubClass, but it calls the SuperClass version.
    Let's test:
    public class Test {
         public static void main(String[] args) throws DatabaseErrorException, TableUpdateException {
              SuperClass.staticMethod();
              SubClass.staticMethod();
    Output:
    Static in SuperClass
    other in SuperClass
    Static in SuperClass
    other in SuperClass
    First line calls static in SuperClass, which calls other (found in SuperClass and executed), the output from other is second line.
    Then, the third line shows calling staticMehod in SubClass, which doesn't redefine it, and executes the SuperClass version, that's ok, but when staticMethod calls other, it doesn't look for it in SubClass, but it directly executes the one in SuperClass (which is shown in line 4).

  • Inheriting inner classes

    Hi everybody,
    I can't seem to find a clear answer on this, and it's probably a silly simple question, but here goes (it needs a little setup first)--
    A base class X has two subclasses, Y and Z.
    Both Y and Z have static inner classes which contain a factory method that calls their constructors (that is, the methods call the constructors for class Y or class Z).
    Is it possible to have an inner class Q in base class X which can be inherited by classes Y and Z and used to call the constructors of Y and Z?
    Making a separate inner class for each subclass works fine, but they are very similar from class to class, and it would be nice to be able to do this to cut down on code.
    If this is possible, I have one more question:
    Is it possible to have an inner class R in class Y that extends inner class Q in class X?
    If anyone could give me some clarification on these questions, and, if possible, the syntax to answer them, I'd appreciate it.
    Thanks,
    Jezzica85

    jezzica85 wrote:
    Is it possible to have an inner class Q in base class X which can be inherited by classes Y and Z and used to call the constructors of Y and Z?No. If you write new Y() you have named the class you are instantiating. There's no simple way (short of reflection) to express "some other class".
    By the way, did you see my reflection example in your other thread?
    Making a separate inner class for each subclass works fine, but they are very similar from class to class, and it would be nice to be able to do this to cut down on code.You can move most common code up the hierarchy.
    >
    If this is possible, I have one more question:
    Is it possible to have an inner class R in class Y that extends inner class Q in class X?The simplest way to find out is to try it:
    class X {
        class Q {}
        static class S {}
    class Y extends X {
        class R extends Q {}
        static class T extends S{}
    }--BDLH                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can someone tell me how many seconds the cross fade is when running your nano in that mode? I teach spin class and want to know how much time I'm losing in that mode.

    can someone tell me how many seconds the cross fade is when running your Ipod 6th Gen nano in that mode? I teach spin class and want to know how much time I'm losing in that mode.

    You aren't losing any time in that mode, but I believe it is a 10 second fade out/fade in.

  • How do I write a Java Class that Loads a RPT and exports to PDF All Automatically?

    <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="2">I am using Crystal Reports for Eclipse and I am trying to create a java class that will do everything independently.<span>  </span>It will take a .rpt file, load it with data from the database and then export that to a pdf file and put that pdf in a specific location with a specific name.</font></p><font face="Times New Roman" size="2"> </font> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="2">I am using the Crystal Reports for Eclipse and the sample jsp project does that but I am looking for a java class example that doesn't require human interaction through the website.<span>  </span>I have read the help file and seen snippet examples but I am not seeing a complete example.<span>  </span>Could someone point me in the proper direction of a good example either in the forum or the help file for eclipse?</font></p>

    <p>Hi,</p><p>    If you wanted to achieve this in a JSP page then I would suggest using the JSP Page Wizard as it allows you to select PDF as an output type. You can run the wizard and choose the PDF output and it will automatically generate the required code for you. </p><p>However, as you want to use a Java class then I would suggest downloading the following package of sample code:</p><p><a href="http://support.businessobjects.com/communityCS/FilesAndUpdates/crxi_r2_jrc_desktop_samples.zip">http://support.businessobjects.com/communityCS/FilesAndUpdates/crxi_r2_jrc_desktop_samples.zip</a> </p><p>This package includes a number of sample Java classes that demonstrate how to use the engine. The one that you will be interested in is titled "<strong>JRCExportReport"</strong> </p><p>To make life easier I would suggest trying the class in a Crystal Reports Web Project as the runtime libraries will automatically be in the classpath. </p><p>Anyway, give this a shot and let me know how you make out. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) <br /><br /> <a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a>          </p>

  • I recently inherited a power mac from my dad how do i change admin passwords and such so I can use it

    I recently inherited a power mac from my dad how do i change admin passwords and such so I can use it?

    And if you can't log into the machine at all, you'll need:
    Mac OS X: Changing or resetting an account password.
    You'll need a system recovery or Mac OS X install disc. Don't drop your Dad's user account, though. If he's got any serialized software, it may not function for all users on the machine, and you may need to go back to his account.

  • How to call a class that extends a frame from a panel ?

    How to call a class that extends a frame from a panel ?
    I am trying to create an application say "Videoshow"
    Videoshow has a panel which in turn consists of 2 components : 1]a textarea( to show the contents of a page) and 2] a mediaclip(to show the video).
    Now I have an application "MediaApplication"(to show the videoclip) which extends Frame (Code from Java 2 Unleashed, Chap 21). I want to show this MediaApplication in Component 2 of the above panel. But when I do this, I only see the MediaApplication frame instead of the whole SlideShow.
    I want to do something likethis.
    VideoShow :
    |---------------------------------|-------------------|
    | |
    | (Comp 1) | (Comp 2)
    | TEXTAREA | Video Clip
    | |(MediaApp entends Frame)
    |---------------------------------|-------------------|
    What is the best way to achieve this ? Also which component can I use to show the videoclip ?

    im not familiar with the code you mention from Java 2 Unleashed, but your best bet is to read up on Swing a bit - so you get an idea of how Swing containers and components work - then im sure you'll find a solution to your problems. Then if you encounter any difficulties whilst your attempting to do that, post your code in the Swing forum and im sure someone will help you.

Maybe you are looking for

  • Itunes wont recognize my iphone 5s!!! Please help

    Hi Everyone.. can someone please help me? Ive been searching this forum for 2 days now and cannot find a fix to the issue I am having. My wife and I had iphone 4s' untill we recently upgraded to the 5s... we got both phones on the same day and simply

  • Problem in the character conversion

    Hi Guys, I am facing problem in the character conversion I am posting data from SAP to third party system using XI , by converting whole input message to a String .I am using SOAP adapter to communicate XI to third party system. Thirdparty system nee

  • Online Gaming

    AirPort Express Base Station. Is this device ideal for use with a PS3/ XBOX

  • Reg:Mapping  (IDOc Segment)

    Hi Guys, In my mapping has many segmants at sender but i need to map one field from one segment to one target filed thats fine if ,but i want to map same fields from all segments to target field. please give me solution Thanks

  • Billing Invoice if Printed more tha once, then it should have copy text

    Hi, Billing Invoice is created in SmartForms.  Requirement is if it is printed more than once, then it should have text "Copy of ...." in the smartform.  Please suggest how it can be configured.  Thanks. Munna.