Complicated Inheritance Problems

Ok, some of you may be getting familiar with these classes :P
Basically;
public class CentredDictionaryWindow extends JFrame
public class welcomeScreenFrame extends CentredDictionaryWindow
public class searchWindowFrame extends CentredDictionaryWindow
public class resultsFrame extends CentredDictionaryWindowNow, searchWindowFrame searches a set of words in a dictionary based on your input, which it then passes to resultsFrame to display.
I have a JMenuBar that I created in CentredDictionaryWindow as well as a JPopupMenu, so that all the screens have it.
One of the options is save. To do this, CentredDictionaryWindow needs the results.
In searchWindowFrame and welcomeScreenFrame I've used
super(null)So they don't need to pass anything in.
resultsFrame uses
super(results)and passes in a TreeSet containing all the results. This seems logically sound, and I've put
if (results != null)
     resultList.addAll(results);which again, should make sense.
However, when I press 'Search' on searchWindowFrame, the end of the code for which is here: (the beginning simply performs the search, that's all fine)
if (operatorSearchFour.size() > 0 && !failedQuery)
     JFrame loading = new loadingWindow();
     setVisible(false);
     loading.show();
     TreeSet searchResults = new TreeSet();
     searchResults.addAll(operatorSearchFour);
     resultsFrame resultFrame = new resultsFrame(searchResults, this, parentWindow);  //(results, parent, home)
     loading.setVisible(false);
     resultFrame.show();
     if (operatorSearchFour.size() == 0)
          JOptionPane.showMessageDialog(new JFrame(), "The Query you entered returned no results." + "\n" + "Please try again.", "Zero Results", JOptionPane.INFORMATION_MESSAGE);I get a null pointer exception on the second line of
if (results != null)
     resultList.addAll(results);Is there something I'm doing wrong? (don't know how more code examples could help none of the rest really has anything to do with this but if you want it, ask) or is there an easier way of doing this? (While still being able to leave the menu in CentredDictionaryWindow - hopefully - because I know I'll lose marks for repeated code otherwise). I can't figure it out at all, especially since the set of results resultsFrame sends in definately isn't null.

if (results != null)
     resultList.addAll(results);To be getting a null pointer here I'm pretty sure resultList == null. Are you initialising this beforehand?

Similar Messages

  • Multiple Inheritance problem persists in Interfaces

    Hi,
    I tentatively made a program and found that multiple inheritance problem of C++ persists even with interfaces. Although this is definetely a special case but I want to know what is this problem known as( i know that this is perhaps known as diamond problem in C++). And is there a way out of this thing.
    interface one
         int i=10;
    interface two
         int i=20;
    interface z extends one,two
    public class xyz implements z
         public static void main(String [] a)
         System.out.println(i);
    }O/P
    D:\Education\Java\JavaStudyRoom\Applets>javac xyz.java
    xyz.java:16: reference to i is ambiguous, both variable i in one and variable i
    in two match
    System.out.println(i);
    *^*
    *1 error*
    Thanks for replying

    suvojit168 wrote:
    I tentatively made a program and found that multiple inheritance problem of C++ persists even with interfaces. Although this is definetely a special case but I want to know what is this problem known as( i know that this is perhaps known as diamond problem in C++). And is there a way out of this thing. This is not the so called diamond inheritance problem. What you have here is an ordinary name clash. And as has been noted you can resolve it by qualifying which constant you're referring to, like
    System.out.println(one.i);
    For the diamond inheritance problem to apply both the one and the two interfaces would need to inherit a common ancestor (that's how the diamond is formed). Furthermore the common anscestor would need to carry implementation which would then be inherited two ways, once via one and once via two. This is the diamond inheritance problem Java is avoiding by allowing single inheritance of implementation only.
    P.S. My previous post was posted my mistake.

  • EJB 3.0 Inheritance problem

    I have to persist classes Cat, BullDog and StBernard:
    class Animal {
    private int animalId;
    private String name;
    private String dtype;
    class Dog extends Animal {
    private int dogId;
    private String furColor;
    class BullDog extends Dog {
    private int bullDogId;
    private int fightCount;
    class StBernard extends Dog {
    private int stbernardId;
    private int livesSaved;
    class Cat extends Animal {
    private int catId;
    private String preferredCatFood;
    }Planned inheritance strategy is joined table strategy. There is no problem mapping and persisting Cat and Dog tables into database, but I cannot find a way how to annotate StBernard and BullDog classes to persist them. Is it possible at all?

    do you know any official doc or reference where I can find statement, that such inheritance is not possible? i.e. only one level inheritance is allowed in JPA? Will check @SecondaryTable to see if it is helpful or not.
    @SecondaryTable This annotation is used to specify a secondary table for the annotated entity class. Specifying one or more secondary tables indicates that the data for the entity class is stored across multiple tables.@SecondaryTable is not for me :(
    Edited by: marekst on Feb 7, 2008 6:36 AM

  • XML mapping inheritance problem; missing class indicator field

    Hi!
    I am currently working on a project which involves mapping a large domain model on a XSD schema. For this we use Toplink 10.1.3.1 which is mostly great. But now I have a problem while wanting to use class inheritance.
    In my XSD I have the following defined
    <xs:complexType name="Traject">
         <xs:sequence>
              <xs:element name="SoortTraject" type="SoortTraject"/>
         </xs:sequence>
    </xs:complexType>
    <xs:complexType name="SpecialTraject">
         <xs:complexContent>
              <xs:extension base="Traject">
                   <xs:sequence>
                                 [some elements] 
                   </xs:sequence>
              </xs:extension>
         </xs:complexContent>
    </xs:complexType>My XML is an implementation of this XSD and looks like this
    <Trajecten>
            <Traject xsi:type="SpecialTraject">
                     [implementation of the elements]
             </Traject>
    </Trajecten>My domain model corresponts to the XSD, so there is a Traject object and an inherited SpecialTraject object.
    In the mapping I used the Advanced properties->inheritance on both descriptors telling the Traject descriptor that it was the 'Root Parent Descriptor' ('Use class indicator field' -> 'use XML Schema Type attribute', 'Use class indicator dictionary') and the SpecialTraject what it Child Descriptor was ('Traject').
    When I test my mapping it always results in the same error (no matter how I configure this inheritance mapping). It says :
    [TOPLINK-44] missing class indicator field
    Descriptor: XMLDescriptor(Traject --> [])What am I doing wrong? Does anybody know a sollution?
    Best regards,
    Jouke Stoel
    Developer

    This is the changed XML descriptor file. When I deploy the file it automaticly overrides the old file so it ain't possible that I was still using the wrong file
    <toplink:class-indicator-mappings>
        <toplink:class-indicator-mapping>
            <toplink:class>Traject</toplink:class>
            <toplink:class-indicator xsi:type="xsd:string">Traject</toplink:class-indicator>
        </toplink:class-indicator-mapping>
        <toplink:class-indicator-mapping>
            <toplink:class>SpecialTraject</toplink:class>
            <toplink:class-indicator xsi:type="xsd:string">SpecialTraject</toplink:class-indicator>
        </toplink:class-indicator-mapping>
    </toplink:class-indicator-mappings>I have posted the stacktrace but I had to translate a bit because my exception was in Dutch :)
    Locale is a great invention
    Exception [TOPLINK-44] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DescriptorException
    Exception description: Missing class indicator field of database row [UnmarshalRecord()].
    Descriptor: XMLDescriptor(Traject --> [])
         at oracle.toplink.exceptions.DescriptorException.missingClassIndicatorField(DescriptorException.java:887)
         at oracle.toplink.internal.ox.QNameInheritancePolicy.classFromRow(QNameInheritancePolicy.java:84)
         at oracle.toplink.internal.ox.XMLRelationshipMappingNodeValue.processChild(XMLRelationshipMappingNodeValue.java:13)
         at oracle.toplink.internal.ox.XMLCompositeCollectionMappingNodeValue.startElement(XMLCompositeCollectionMappingNodeValue.java:62)
         at oracle.toplink.ox.record.UnmarshalRecord.startElement(UnmarshalRecord.java:352)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:205)
         at oracle.toplink.internal.ox.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:189)
         at oracle.toplink.internal.ox.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:147)
         at oracle.toplink.ox.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:228)
    .

  • Inheritance problems

    I'm trying to work out a problem with a project I'm working on that uses inheritance.
    the superclass consists of a prebuild GUI using swing, when more then one class enherits from the superclass for some reason its like they are sharing the subclass, any changes to the GUI done in one subclass affects the other, so if I add a JScrollPane to the Container from the inherited class it stayes after the window is closed AND its there when the other subclass runs.
    What I want is for both subclasses to have their own instances of the subclass, or in other words I don't want the changes done in one subclass to affect the other subclass, is this possible?
    My best guess is that instead of getting their own copy of the subclass they are sharing the same one so when one subclass does any changes the other reflects those changes because they are working with the exact same instance of the superclass. I have an idea of what my problem is I just don't know how to stop it from hapening.

    It seems to me you are very confused as to how your inheritance tree works and from your description there is a clear design fault. It may well be you are diasy-chaining your classes and have got design in a fart with logic and flow - ie:
    class A{ // superclass
    class B extends A{} // so if B is an application GUI
    class C extends B{} // C gets messed up
    class D extends C{} // and application GUI D gets knackered too
    This type of design rarely works well (if at all). You need to literally go back to the 'drawing board' and consider what you're trying to do with good design principles.
    I'm not sure anyone here can really help you with this unless you give a detailed description of what you're trying to do (not code), though from what I CAN gather it should be something like;-
    class AllComponentsFrame{}
    /* class AmendedComponentsFrame1 extends AllComponentsFrame{} // maybe? */
    class FinalGUI1 extends AllComponentsFrame{}
    class FinalGUI2 extends AmendedComponentsFrame1 {}

  • Object Inheritance problem between projects

    Hi,
    I have two projects lets say project1 and project2. From project1 I instanciate processes of project2 as subflows. In addition I have one bpm object in project1 (lets say object1) that inherits from a bpm object in proyect2 (lets say object2). So project1 depends on project2 to make this inheritance happen. When I call the subflow I pass the object1 and as inherits from object2 there is no problem (input argument). For the output argument I have to cast from object2 to object1. And here is where I have a classcastexception. If all the processes are in the same project it works fine and there is no exception. But when splitting in two projects it fails. Seems that it is something related to the folder structure in the catalog that should be the same for both projects and that is the reason why it does not work, but as one project depends to the other I can not put the same folder structure in both catalogs because in the dependant project it is duplicated.
    Has anybody can give me an idea on how to solve this?
    Thank you very much in advance
    Kind regards

    Nobody can help me with this issue?,any help is much appreciated, the excpetion I get is:
    An operation exception occurred while running an automatic item. Details: An instance in Process '/Prueba#Default-1.0' could not be notified. Caused by: Process execution engine execution error. Caused by: The method 'CIL_otherProjectOtherProjectIn' from class 'Novartis.Prueba.Default_1_0.Instance' could not be successfully executed. Caused by: Cannot convert an object with type xobject.BaseModule.BaseObject to class xobject.DependantModule.DependantObject fuego.papi.exception.CannotStoreNotificationException: An instance in Process '/Prueba#Default-1.0' could not be notified. at fuego.server.AbstractProcessBean.receiveNotification(AbstractProcessBean.java:2791) at fuego.server.iec.LocalIPCHandler.sendNotification(LocalIPCHandler.java:79) at fuego.server.execution.microactivity.DefaultSendNotificationExecutionHandler.sendNotification(DefaultSendNotificationExecutionHandler.java:103) at fuego.server.execution.microactivity.EndMicroActivity.execute(EndMicroActivity.java:69) at fuego.server.execution.microactivity.MicroActivityEngineExecutionHandler.executeActivity(MicroActivityEngineExecutionHandler.java:57) at fuego.server.execution.ImmediateActivity.execute(ImmediateActivity.java:42) at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304) at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:470) at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:551) at fuego.transaction.TransactionAction.start(TransactionAction.java:212) at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123) at fuego.server.execution.DefaultEngineExecution.executeAutomaticWork(DefaultEngineExecution.java:62) at fuego.server.execution.EngineExecution.executeAutomaticWork(EngineExecution.java:42) at fuego.server.execution.ToDoItem.executeAutomaticWork(ToDoItem.java:251) at fuego.server.execution.ToDoItem.run(ToDoItem.java:536) at fuego.component.ExecutionThread.processMessage(ExecutionThread.java:775) at fuego.component.ExecutionThread.processBatch(ExecutionThread.java:755) at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:142) at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:134) at fuego.fengine.ToDoQueueThread$PrincipalWrapper.processBatch(ToDoQueueThread.java:450) at fuego.component.ExecutionThread.work(ExecutionThread.java:839) at fuego.component.ExecutionThread.run(ExecutionThread.java:408) Caused by: fuego.papi.impl.EngineExecutionException: Process execution engine execution error. at fuego.server.execution.DefaultEngineExecution.executeWithoutComponentImmediate(DefaultEngineExecution.java:202) at fuego.server.execution.EngineExecution.executeWithoutComponentImmediate(EngineExecution.java:95) at fuego.server.AbstractProcessBean.receiveNotification(AbstractProcessBean.java:2757) ... 21 more Caused by: fuego.lang.ComponentExecutionException: The method 'CIL_otherProjectOtherProjectIn' from class 'Novartis.Prueba.Default_1_0.Instance' could not be successfully executed. at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:519) at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:273) at fuego.fengine.FEEngineExecutionContext.invokeMethodAsCil(FEEngineExecutionContext.java:219) at fuego.server.execution.EngineExecutionContext.runCil(EngineExecutionContext.java:1277) at fuego.server.execution.microactivity.ComponentExecutionMicroActivity.runCil(ComponentExecutionMicroActivity.java:126) at fuego.server.execution.microactivity.ComponentExecutionMicroActivity.execute(ComponentExecutionMicroActivity.java:84) at fuego.server.execution.microactivity.MicroActivityEngineExecutionHandler.executeActivity(MicroActivityEngineExecutionHandler.java:57) at fuego.server.execution.ImmediateActivity.execute(ImmediateActivity.java:42) at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304) at fuego.transaction.TransactionAction.startNestedTransaction(TransactionAction.java:527) at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:548) at fuego.transaction.TransactionAction.start(TransactionAction.java:212) at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123) at fuego.server.execution.DefaultEngineExecution.executeWithoutComponentImmediate(DefaultEngineExecution.java:199) ... 23 more Caused by: java.lang.ClassCastException: Cannot convert an object with type xobject.BaseModule.BaseObject to class xobject.DependantModule.DependantObject at fuego.util.Conversion.cast(Conversion.java:99) at Novartis.Prueba.Default_1_0.Instance.CIL_otherProjectOtherProjectIn(Instance.xcdl:1) at Novartis.Prueba.Default_1_0.Instance.CIL_otherProjectOtherProjectIn(Instance.xcdl) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:512) ... 36 more
    The strange thing is that if all the processes are in the same project everything works fine but once I split in two projects it raises the exception.
    Thank you very much

  • Java ME 3.0 Web Services Stub Generator  Inheritance problem

    Hello,
    I have a problem with that relates to inheritance.
    Suppose I have abstract class User and class Member that extends class User.
    Suppose I have web service MyService:
    @WebService
    public class MyService {
    public User getUser(int id) {
    // do something
    When the server returns a Member instance instead of User I receive a MarshalException at the Client.
    The reason is " Invalid Element in Response:" + Member field that isn't part of User.
    I am using Java Me SDK 3.0 wscompile stub generator.
    I have also checked it with GlassFish stub generator wsimport and there the problem didn't appear.
    Ideas ?
    Thanks in advance,
    Raanan

    Seems like you are missing a necessary jar-file in your forms-classpath. Check the libraries attached to your project in Jdeveloper and add them to the path.

  • Complicated realm problem

    Hello,
    I have to write a WebLogic realm that ist based on a backend like this
    one:
    public interface UserContainer {
    public boolean containsUser (String userName, String password);
    i.e. the backend contains a number of users, represented by
    (username,password) tuples, and one can ask the backend whether or not
    it contains a specific user.
    There is no way to get a list of all users contained in the backend
    I now wanted to map all the backend's users into a group, so I could
    uniformly apply permissions to them. However, as one can't get a list
    of the users, I can't imagine how to implement the getGroup(String
    name) method in my realm...?
    So I came up with a different solution: I map all the user entries in
    the backend to a single generic weblogic user named "GenericUser": In
    the authUserPassword(String name, String password) method of my realm,
    I query the backend whether it contains (name,password) and if so, I
    just return a new weblogic.security.acl.User("GenericUser") (else, I
    return null).
    This works so far, but there is a problem: I'm using the realm in a
    servlet-driven web application. From inside the servlet, I have to
    know the "real" name and the password of the currently authenticated
    user, i.e. the "name" and "password" values that were passed to my
    authUserPassword() method when the user was authenticated. If I call
    request.getUserPrincipal().getName() from inside the servlet, it
    returns "GenericUser" (no surprise). So I wrote a subclass
    "MappingUser" which inherits from weblogic.security.acl.User and adds
    the fields "actualName" and "actualPassword", like this:
    public class MappingUser extends weblogic.security.acl.User {
    private String mActualName;
    private String mActualPassword;
    public MappingUser (String pName, String pActualName, String pActualPassword) {
    super (pName);
    mActualName = pActualName;
    mActualPassword = pActualPassword;
    public String getActualName() {
    return mActualName;
    public String getActualPassword() {
    return mActualPassword;
    From authUserPassword(String name, String password) I now return a new
    MappingUser ("GenericUser", name,password). However: when I now call
    request.getUserPrincipal() from within my servlet, it still returns an
    object whose dynamic type is weblogic.security.acl.User . Somehow my
    MappingUser got lost on its way from authUserPasword to
    request.getUserPrincipal (obviously, it was statically copied into a
    weblogic.security.acl.User, so my subclass attributes were not
    retained).
    Could somebody shed some light please? How could I get to know the
    name and password of the currently authenticated user from within my
    servlets, given the above backend?
    I'm using WLS 5.1 .
    Thanks in advance,
    Olaf
    Olaf Klischat | Fraunhofer ISST
    Oberfeldstrasse 132 | Mollstrasse 1
    12683 Berlin, Germany | 10178 Berlin, Germany
    phone: +49 30 54986231 | mail: [email protected]

    once you've converted it its under the file of vidoera ipod converter in program files (or whereever you downloaded it) then you go to itunes, go to file press add file to library and find that program under program files, etc. then once you find the videora folder click videos and then it should work
    happy holidays

  • Inheritance problem with parent class calling child class

    I have a problem with inheritance with a parent class calling a child class method. Below is the example pseudocode code and my problem:
    public abstract class A {
        protected void function1 ( ) { }
        protected void function2 () {
             //calls function1();
             function1();
    public abstract class B extends A {
        protected void function1 ()  {
             // do stuff
    public class C extends B {
        protected void function1 ()  {
            // do stuff
            super.function1 ();
    }I have an object instance of class C created and its function2() is invoked.
    My problem is, while in function2(), which belongs to abstract class A and the method call to function 1() is called, the call invokes the function1() of class B. Shouldn't the call invoke function 1() of class C instead? And then function1() of class B will be called after due to the super.function1(). It's not behaving like I thought it would.
    Edited by: crono77 on Jan 10, 2008 8:13 PM

    Nevermind, i found my error :)

  • Inheritance problem

    I have a super class and two subclass which is extend the super class. I add a mouse handler in one of the subclass. The problem is that the other subclass also affect by the mouse handler. How can i avoid that??
    here is the code
    public abstract class SketchView extends JPanel implements Observer, Constants, ActionListener, Printable, Pageable
    public SketchView(Sketcher theApp, SketchModel sketcherModel)
    this.sketcherModel = sketcherModel;
    this.theApp = theApp;
    public class DocView extends SketchView
    public DocView(Sketcher theApp, SketchModel sketcherModel)
    super(theApp, sketcherModel);
    MouseHandler handler = new MouseHandler();
    addMouseListener(handler);
    addMouseMotionListener(handler);
    class MouseHandler extends MouseInputAdapter
    public class ReportView extends SketchView
    public ReportView(Sketcher theApp, SketchModel sketcherModel)
    super(theApp, sketcherModel);
    I only add mouse handler in the DocView class, but the ReportView also have the mouse event. how can i fix this problem? pls help

    To: remu
    Thank for your reply.
    Following is the origanal code
    public abstract class SketchView extends JPanel implements Observer, Constants, ActionListener, Printable, Pageable
    public SketchView(Sketcher theApp, SketchModel sketcherModel)
    this.sketcherModel = sketcherModel;
    this.theApp = theApp;
    public static class DocView extends SketchView
    public DocView(Sketcher theApp, SketchModel sketcherModel)
    super(theApp, sketcherModel);
    MouseHandler handler = new MouseHandler();
    addMouseListener(handler);
    addMouseMotionListener(handler);
    class MouseHandler extends MouseInputAdapter
    public static class ReportView extends SketchView
    public ReportView(Sketcher theApp, SketchModel sketcherModel)
    super(theApp, sketcherModel);
    Before remove the static, my program can run, but the ReportView have the mouse event too. After i remove the static, i can't compile my program. The error is
    SketchFrame.java:460: not an enclosing class: SketchView SketchView view = new SketchView.ReportView(theApp, sketch);
    ^
    .\Sketcher.java:137: not an enclosing class: SketchView
    view[internalFrameCount] = new SketchView.DocView(this, sketch[internalFrameCount]); // Create the view
    ^
    2 errors
    is it possible that the static cause the problem??

  • Window inheritance problem, implementation question

    This is a multi-part message in MIME format.
    --------------F5AF60803BB8EFA34C8D4288
    Content-Type: multipart/alternative;
    boundary="------------24CDBE5DFBEC0C4205C15C80"
    --------------24CDBE5DFBEC0C4205C15C80
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    Hi!
    I have a window inheritance and implementation question. I'm using
    Forte 3.0.J.1.
    I have a super (base) window with a PushButton on it. I want to
    handle the Click event of the button in this super window therefore
    I create an event handler.
    <MyBtn> : PushButton
    I create a sub window inheriting from the previous super window.
    I put some data widgets on it and group all of them (the inherited
    button as well) into a GridField. When I set the mapped type of the grid
    the name of the inherited PushButton widget changes:
    <MainGrid.MyBtn> : PushButton
    When I run the application I get a SystemException with the
    message:
    Attempt to register an event on a NIL object (qqds_C_FieldWidget, 10).
    Traceback:
    SuperWindow.EH at line 0
    SubWindow.Display at line 5
    C++ Method(s)
    UserApp.Run at offset 105
    It is quite understandable that in runtime there is no widget called
    <MyBtn>
    and the event handler of the super class fails.
    But what I don't know : after specifing a mapped type of a GridField why
    changes
    the name of those widgets that haven't got mapped type e.g.: PushButton,
    PictureButton etc.
    How to solve this situation?
    I made a sall example which i send in attachment.
    Thanks for any help and advice in advance...
    Attila Racz Lufthansa Systems
    Hungary
    BUD LSYH
    E-mail: [email protected] .-``'.
    Tel.: (36 1) 431-2910 .` .' Mazsa ter 2-6.
    Fax : (36 1) 431-2977 _.-' '._ H-1107 Budapest,
    Hungary
    --------------24CDBE5DFBEC0C4205C15C80
    Content-Type: text/html; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <tt>    Hi!</tt><tt></tt>
    <p><tt>I have a window inheritance and implementation question. I'm using</tt>
    <br><tt>Forte 3.0.J.1.</tt><tt></tt>
    <p><tt>I have a super (base) window with a PushButton on it. I want to</tt>
    <br><tt>handle the Click event of the button in this super window therefore</tt>
    <br><tt>I create an event handler.</tt><tt></tt>
    <p><tt>&lt;MyBtn> : PushButton</tt><tt></tt>
    <p><tt>I create a sub window inheriting from the previous super window.</tt>
    <br><tt>I put some data widgets on it and group all of them (the inherited</tt>
    <br><tt>button as well) into a GridField. When I set the mapped type of
    the grid</tt>
    <br><tt>the name of the inherited PushButton widget changes:</tt><tt></tt>
    <p><tt>&lt;MainGrid.MyBtn> : PushButton</tt><tt></tt>
    <p><tt>When I run the application I get a SystemException with the</tt>
    <br><tt>message:</tt><tt></tt>
    <p><tt>Attempt to register an event on a NIL object  (qqds_C_FieldWidget,
    10).</tt>
    <br><tt>      Traceback:</tt>
    <br><tt>          SuperWindow.EH
    at line 0</tt>
    <br><tt>          SubWindow.Display
    at line 5</tt>
    <br><tt>          C++ Method(s)</tt>
    <br><tt>          UserApp.Run
    at offset 105</tt><tt></tt>
    <p><tt>It is quite understandable that in runtime there is no widget called
    &lt;MyBtn></tt>
    <br><tt>and the event handler of the super class fails.</tt><tt></tt>
    <p><tt>But what I don't know : after specifing a mapped type of a GridField
    why changes</tt>
    <br><tt>the name of those widgets that haven't got mapped type e.g.: PushButton,</tt>
    <br><tt>PictureButton etc.</tt><tt></tt>
    <p><tt>How to solve this situation?</tt>
    <br><tt>I made a sall example which i send in attachment.</tt><tt></tt>
    <p><tt>Thanks for any help and advice in advance...</tt><tt></tt>
    <p><tt>---------------------------------------------------------------------------</tt>
    <br><tt> Attila Racz                                    
    Lufthansa Systems Hungary</tt>
    <br><tt>                                                
    BUD LSYH</tt>
    <br><tt>E-mail: [email protected]      
    .-``'.</tt>
    <br><tt>Tel.: (36 1) 431-2910               
    .`   .'     Mazsa ter 2-6.</tt>
    <br><tt>Fax : (36 1) 431-2977           
    _.-'     '._    H-1107 Budapest, Hungary</tt>
    <br><tt>---------------------------------------------------------------------------</tt>
    <br><tt></tt> </html>
    --------------24CDBE5DFBEC0C4205C15C80--
    --------------F5AF60803BB8EFA34C8D4288
    Content-Type: application/x-zip-compressed;
    name="Inh.zip"
    Content-Transfer-Encoding: base64
    Content-Disposition: inline;
    filename="Inh.zip"
    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
    --------------F5AF60803BB8EFA34C8D4288--

    import javax.swing.JOptionPane;
    public class Test{
         public static void main(String[] args)
              String newItem = "Item";
              float newSerial = 4234;
              float newCode = 3424;
              int newBase = 1000;
              boolean YesWarranty = true;
              boolean NoWarranty = true;
              Machinery test1 = new Machinery(newItem, newCode, newSerial, newBase, YesWarranty, NoWarranty);
              JOptionPane.showMessageDialog(null, "Item: " + test1.getItem() + " Serial: " + test1.getSerial() + " Code: " + test1.getCode()
              + " Warranty: " + test1.IncludeWarranty() + " No Warranty: " + test1.ExcludeWarranty()+ " Base: " + test1.getPrice());
    }Tested with this and it seems to be ok?
    Changed my final code too because it seemed to always add the 10% whether YesWarranty was true or false, so made it
              if (TrueWarranty==true) //There is a warranty, it returns the base price plus 10%
                   return (base+((base/100)*10));May have posted here too early if it does work, but there is another part so if ive trouble with that il be back :P
    Edited by: dave_the_bear on 16-Nov-2010 07:17
    Changed base to double and used the *0.1 method

  • Complicated Query Problem - Booking System

    I am currently developing a hotel booking system for my University final year project and am having some serious problems with my queries to calculate room availability.
    I felt the best method to calculate room availability was to first calculate which rooms were already booked for any specific queried dates and then to subtract those results from the list of total rooms. That would then return which rooms were available on those dates.
    My first query successfully calculated which rooms were already booked using my test dates which were rooms 1,3 & 5. This result was stored in a temporary table. The second query then obtained the list of total rooms (1-10) and from this subtracted the results in the temporary table (1,3 & 5) which should have returned 2,4,6,7,8,9,10 as the rooms available. However, it returned the rather strange result "2,3,4,5,6,7,8,9,10,1,2,4,5,6,7,8,9,10,1,2,3,4,6,7,8,9,10"
    It seems to take each result from the temporary table individually, subtract it from the total list of rooms, return the result and then move on to the next value in the temporary table. Which is why '1' is missing from the first 9 numbers, '3' from the second 9 and '5' from the last 9.
    If anyone can help me solve this problem or suggest alternative methods I would be most appreciative.
    Below is my MySQL code for the relevant parts of my database, the test values I am using and the two queries I am having problems with.
    Advance Thanks!
    CREATE TABLE booking
    booking_id               INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    e_mail                VARCHAR(40),
    arrival_date          DATE NOT NULL,
    departure_date          DATE NOT NULL,
    PRIMARY KEY(booking_id)
    insert into booking (booking_id,e_mail,arrival_date,departure_date)
    values ('[email protected]','2004-02-25','2004-02-28');
    CREATE TABLE roombooked
    booking_id      INTEGER UNSIGNED NOT NULL REFERENCES booking(booking_id),
    room_id               INTEGER UNSIGNED NOT NULL REFERENCES rooms(room_no),
    no_of_nights          INTEGER UNSIGNED NOT NULL,
    PRIMARY KEY(booking_id,room_id)
    insert into roombooked(booking_id,room_id,no_of_nights)
    values ('1','1','1'),('1','3','1'),('1','5','1');
    CREATE TABLE rooms
    room_no               INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    room_name           VARCHAR(11),
    room_type               VARCHAR(9),
    single_price          DECIMAL(5,2),
    double_price          DECIMAL(5,2),
    PRIMARY KEY(room_no)
    insert into rooms (room_name,room_type,single_price,double_price)
    values ('shakespeare','principal','165','225'),
    ('keats','principal','165','225'),
    ('kipling','standard','125','165'),
    ('tennyson','superior','135','185'),
    ('shelley','deluxe','155','205'),
    ('brooke','superior','135','185'),
    ('wordsworth','deluxe','155','205'),
    ('milton','deluxe','155','205'),
    ('masefield','deluxe','155','205'),
    ('browning','deluxe','155','205');
    FIRST QUERY
    CREATE TEMPORARY TABLE roomsoccupied          
    SELECT roombooked.room_id FROM roombooked, booking
    WHERE
    roombooked.booking_id = booking.booking_id
    AND
    booking.arrival_date = '2004-02-25'
    AND
    booking.departure_date = '2004-02-28';
    SECOND QUERY
    SELECT rooms.room_no FROM rooms, roomsoccupied
    WHERE
    rooms.room_no != roomsoccupied.room_id;

    you haven't got a join in your second query
    SECOND QUERY
    SELECT rooms.room_no FROM rooms, roomsoccupied
    WHERE
    rooms.room_no != roomsoccupied.room_id;will return rubbish because you have created a valid view of your data with a sensible join.
    try something like
    SELECT rooms.room_no FROM rooms
    WHERE rooms.room_no NOT IN (SELECT roomsoccupied.room_id FROM roomsoccupied);instead, which I believe should give you more meaningful data

  • CSS inheritance problem

    Hi all, I have a CSS problem. Consider the following markup:
    <p class="bigText">
    some big text
    <span>some more text</span>
    </p>
    and the following css:
    .bigText{
    font-size:50px;
    Ok. Now, I want the text inside the span, to be styled just
    like normal text on the page, that is,
    to inherit the font size declared in the body:
    body{
    font-size:??px;
    The catch is that I do not know what the text size of the
    body is (that's customizable by the user).
    I just want the span inside the .bigText p to be the same
    size than what the body says, whatever it
    says...
    Is that possible?
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    An Ingenious WebSite Builder:
    http://sitelander.com

    DUH! "right" = "write"
    Walt
    "Walt F. Schaefer" <[email protected]> wrote in
    message
    news:f8ltil$f6c$[email protected]..
    > Could you right your HTML this way:
    >
    > <p><span class="bigText">
    > some big text</span>
    > some more text
    > </p>
    >
    > I think that does what you want and it seems (to me)
    simpler.
    >
    > --
    >
    > Walt
    >
    >
    > "(_seb_)" <[email protected]> wrote in message
    > news:f8lsd9$dus$[email protected]..
    >> Hi all, I have a CSS problem. Consider the following
    markup:
    >>
    >> <p class="bigText">
    >> some big text
    >> <span>some more text</span>
    >> </p>
    >>
    >> and the following css:
    >>
    >> .bigText{
    >> font-size:50px;
    >> }
    >>
    >> Ok. Now, I want the text inside the span, to be
    styled just like normal
    >> text on the page, that is, to inherit the font size
    declared in the body:
    >>
    >> body{
    >> font-size:??px;
    >> }
    >>
    >>
    >> The catch is that I do not know what the text size
    of the body is (that's
    >> customizable by the user).
    >> I just want the span inside the .bigText p to be the
    same size than what
    >> the body says, whatever it says...
    >>
    >> Is that possible?
    >>
    >>
    >>
    >> --
    >> seb ( [email protected])
    >>
    http://webtrans1.com | high-end web
    design
    >>
    >> An Ingenious WebSite Builder:
    http://sitelander.com
    >
    >

  • MappedSuperclass inheritance problem

    Using Oracle TopLink Essentials - 2006.6 (Build 060608)
    Here is the hierarchy:
    @MappedSuperclass
    public abstract class AbstractEntity implements Serializable, Persistable {
    @Version
    @Column(name="VERSION")
    private Integer version;
    @Entity
    @TableGenerator(name = "event", table = "ID_GEN", pkColumnName = "GEN_KEY", valueColumnName = "GEN_VALUE", pkColumnValue = "EVENT_POID", allocationSize = 1)
    @Table(name = "EVENT")
    @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
    @DiscriminatorColumn(name = "EVENT_TYPE")
    public abstract class Event extends AbstractEntity {
    @Entity
    @DiscriminatorValue(value = "APPOINTMENT")
    public class Appointment extends Event {
    Results in the following exception
    Exception Description: Multiple writable mappings exist for the field [EVENT.VERSION]. Only one may be defined as writable, all others must be specified read-only.
    What am I missing? I am using field annotations, I do not override the version on any subclass nor add any further annotation for VERSION, where in the heck is it getting a second mapping?
    This does not occur when using Toplink essentials v2 b56. However I am unable to query for the Appointments in the DB using find(Appointment.class,1).
    Thanks.

    Ignore the reference to search for the Appointment class. That was a separate issue.

  • Default visibility interface inheritance problem

    I have these constructs:
    package bar;
    public interface A {
    void Foo()
    package bar;
    public class B extends C implements A {
    void Foo() {
    This produces following compile error:
    Cannot reduce the visibility of the inherited method from A. The error does not occur if I make B::Foo() public.
    Why does the error occur?
    Thanks in advance,
    -Lev

    the default visability for interfaces are public for methods and public static final for variables. The
    default modifier for classes are packager-scope and variables are non-static, non-final by default.
    For this reason and others I prefer to state explicitly what modifiers I expect the methods and variables to have.... and believe me, you're not the only one ;-)
    lazyness is often leading to omitting modifiers, wiseness always recommends to be as explicit as possible.

Maybe you are looking for