DrawImage() and multiple classes

First I should start by saying I am VERY new to Java. I have written a program that uses multiple classes, and i would like to place      boolean b = g.drawImage(cardPics,x2,yPos,50,75),this); in my class. I have passed Graphics g from paint. I am able to use g.drawString, etc, but when I try to drawImage, it will not even compile. I CAN use
boolean b = g.drawImage(cardPics[i],x2,yPos,50,75),this); in paint outside of the classes, so I believe I have the image array set up right.
This is what the compilers reads:
cannot resolve symbol
     boolean b =g.drawImage(cardPics[i],x2,yPos,50,75),this);
(The symbol that it is referring to is the period between g and drawImage)
Any help is greatly appreciated.
Thankyou
Apryl

Actually, I did fiigure it out. The problem was that drawImage was being handed an ImageObserver, when infact it didn't need one. But drawImage needs an imageObserver as a parameter, so instead using 'this' you replace it with null.
Thanks for all of the help

Similar Messages

  • Java Applets and multiple classes not working.

    I have tested my JApplet class alone to view its layout and to make sure it actually works. But once I add in my other classes, compile, jar, and test I get the error:
    java.lang.NoClassDefFoundError: AlakApp (wrong name: alak/codeFiles/AlakApp)
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    4)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
            at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:155)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:127)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:618)
            at sun.applet.AppletPanel.createApplet(AppletPanel.java:779)
            at sun.applet.AppletPanel.runLoader(AppletPanel.java:708)
            at sun.applet.AppletPanel.run(AppletPanel.java:362)
            at java.lang.Thread.run(Thread.java:619)My Directory contains these and only these:
    F:\alak\codeFiles:
      AlakApp.java
      Game.java
      Board.java
      Space.java
      index.html
      AlakGame.jarAll my classes are in the package alak.codeFiles.
    My .html file contains this:
    <HTML>
    <HEAD>
      <TITLE>ALAK</TITLE>
    </HEAD>
    <BODY>
      <applet code="AlakApp.class" archive="AlakGame.jar" width=400 height=200>
      Please use a Java compatible browser to see this.
      </applet>
      <br>
    </BODY>
    </HTML>These are they commands I am issuing:
    F:\alak\codeFiles>javac *.java
    F:\alak\codeFiles>jar -cvf AlakGame.jar *.class
    F:\alak\codeFiles>appletviewer index.htmlI've been trying many different things to narrow down what is going on. If you need to see my code let me know, but I've tested everything with a text-based user interface and they work.
    So does anyone know the cause of this error?

    Ok i rared the test and uploaded to rapidshare.. here is the link:
    http://rapidshare.com/files/76860865/test.rar.html
    But here is the code. They are in the directory /test/files/
    ADigit.java
    package test.files;
    public class ADigit
      private int value;
      public ADigit( int val )
       this.value = val;
      public String toString()
       return "" + this.value;
    }ADigitApp.java
    package test.files;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ADigitApp extends JApplet implements ActionListener
      private ADigit numeroUno;
      private int currentNum;
      private Container container;
      private javax.swing.JLabel jLabel;
      private javax.swing.JTextArea jTextArea;
      private javax.swing.JButton jButton;
      public void init()
        currentNum = 1;
        numeroUno = new ADigit( currentNum );
         container = getContentPane();
        container.setLayout( new BorderLayout() );
         jLabel = new javax.swing.JLabel();
         jTextArea = new javax.swing.JTextArea();
         jLabel.setText( "The Number is: " );
         jTextArea.setText( numeroUno.toString() );
         jButton = new javax.swing.JButton();
         jButton.setText( "New Number" );
        jButton.addActionListener( this );
         container.add( jLabel, BorderLayout.WEST );
         container.add( jTextArea, BorderLayout.CENTER );
         container.add( jButton, BorderLayout.EAST );
        setSize( 200, 200 );
      public void actionPerformed( ActionEvent e )
        this.currentNum++;
         numeroUno = new ADigit( this.currentNum );
         jTextArea.setText( numeroUno.toString() );
    }index.html
    <HTML>
    <HEAD>
      <TITLE>NUMBERSSSS</TITLE>
    </HEAD>
    <BODY>
      <applet code="ADigitApp.class" archive="NumberFun.jar" width=200 height=200>
      Please use a Java compatible browser to see this.
      </applet>
      <br>
    </BODY>
    </HTML>Commands:
    /test/files>javac *.java
    /test/files>jar -cvf NumberFun.jar *.class
    /test/files>appletviewer index.htmlThis example produces the same style of error.

  • Multiple classes and drawImage

    First I should start by saying I am VERY new to Java. I have written a program that
    uses multiple classes, and i would like to place boolean b =
    g.drawImage(cardPics[j],x2,yPos,50,75),this); in my class. I have passed Graphics g
    from paint. I am able to use g.drawString, etc, but when I try to drawImage, it will
    not even compile. I CAN use
    boolean b = g.drawImage(cardPics[j],x2,yPos,50,75,this); in paint outside of the
    classes, so I believe I have the image array set up right.
    This is what the compilers reads:
    cannot resolve symbol
    boolean b =g.drawImage(cardPics[j],x2,yPos,50,75,this);
    (The symbol that it is referring to is the period between g and drawImage)
    Any help is greatly appreciated.
    Thankyou
    Apryl

    The last argument to drawImage must be an ImageObserver. Therefore, for this line of code to work, it must be placed in a non-static method of a class that implements ImageObserver.

  • How to compile and register a Java CFX tag with multiple class files?

    All-
    If this is the wrong forum for CFX questions, please let me
    know.
    I need to determine how to compile and register a Java CFX
    tag that contains multiple class files. One class file implements
    the CustomTag interface and the other class files implement various
    supporting classes. All of the documentation that I have found
    talks about using a single class file. I am assuming that a JAR
    file will be involved, but I am not sure of the specifics.
    Thanks in advance for your help.
    -Josh

    Yes, it will involve a jar. Use your java IDE (eclipse,
    etcetera ..) to create a jar containing all of the classes. Check
    your ide's documentation for how to create jar files. After you
    have created the jar, place the jar in the CF class path so CF will
    recognize it. For example the {cf_root}/WEB-INF/lib directory. CF
    must be restarted before it will detect the new jar. After
    restarting CF, register the CFX tag in the ColdFusion Administrator
    using the name of the class that implements the CustomTag
    interface.
    Though it is worth noting you can also instantiate java
    classes directly from ColdFusion (ie without using a CFX
    tag).

  • Accessing the same object from multiple classes.

    For the life of me I can't workout how I can access things from classes that haven't created them.
    I don't want to have to use "new" multiple times in seperate classes as that would erase manipulated values.
    I want to be able to access and manipulate an array of objects from multiple classes without resetting the array object values. How do I create a new object then be able to use it from all classes rather than re-creating it?
    Also I need my GUI to recognize the changes my buttons are making to data and reload itself so they show up.
    All help is good help!
    regards,
    Luke Grainger

    As long as you have a headquarters it shouldn't be to painfull. You simply keep a refrence to your ShipDataBase and Arsenal and all your irrellevant stuff in Headquarters. So the start of your Headquarters class would look something like:
    public class Headquarters{
      public Arsenal arsenal;
      public ShipDatabase db;
    //constructor
      public Headquarters(){
        arsenal = new Arsenal(this, ....);
        db = new ShipDatabase(...);
    //The Arsenal class:
    public class Arsenal{
      public Headquarter hq;
      public Arsenal(Headquarter hq, ....){
        this.hq = hq;
        .Then in your ShipDatabase you should, as good programing goes, keep the arraylist as a private class variable, and then make simple public methods to access it. Methods like getShipList(), addToShipList(Ship ship)....
    So when you want to add a ship from arsenal you write:
    hq.db.addToShipList(ship);
    .Or you could of course use a more direct refrence:
    ShipDatabase db = hq.db;
    or even
    ShipList = hq.db.getShipList();
    but this requires that the shiplist in the DB is kept public....
    Hope it was comprehensive enough, and that I answered what you where wondering.
    Sjur
    PS: Initialise the array is what you do right here:
    //constructor
    shipList = new Ship[6];
    shipList[0] = new Ship("Sentry", 15, 10, "Scout");
    " " " "etc
    shipList[5] = new Ship("Sentry", 15, 10, "Scout");PPS: To make code snippets etc. more readable please read this article:
    http://forum.java.sun.com/faq.jsp#messageformat

  • Multiple classes in the same source file

    I'm not sure what this is called, having multiple classes in the same source file. At first I thought it ws called subclassing but then I googled it and found that subclasses are just derived classes. Here's an example of what I'm talking about.
    public class A {
    class B {
    class C {
    }So first of all, what is having multiple classes in the same source file called?
    Secondly, what are the advantages/disadvantages of this?
    Thirdly, can you have a class completely WITHIN a class (same source file but inside the class not outside) and what are the advantages/disadvantages of this?

    Advantage: You can reduce the number of source files specialy when your secondry classes are used only in the public class of the file.
    Disadvantage: Normaly it make things more clear if we have one-to-one correspondance of class and source files. This make things easy when you want to find the java file of a perticuler class file. Also If you later wanted to create a seperate public class with a same name as one of those secondry classes you got lots of changes to do.
    You can avoid this by creating them as nested classes
    ex:-
    public class MyPublicClass{
       private static class MyInnerClass{
    }this way the inner class will create a class file with name "MyPublicClass$MyInnerClass.class" instead of just "MyInnerClass.class"
    And also if you declare the inner class as public you can access them from out side

  • Multiple classes in one file?

    I would like to do the following
    #import <UIKit/UIKit.h>
    @interface O : NSObject
    @end
    @interface A : O
    - (void) hi;
    @end
    @interface B : O
    - (void) hi;
    @end
    but the compiler complains. I do not want to create (O.h, O.m), (A.h, A.m), and (B.h, B.m) files. Surely one can declare multiple classes in a single file? If so, how. If not, why not?
    -Doug Danforth

    I've done that, should work. What is the compiler complaining about?
    Could it be the missing semicolons after the @end statements?

  • Java stored procedures and referencing classes

    We are referencing to some classes/libraries which are not present in the database. In normal java world, you specify the libraries/classes needed to run your piece of code in the CLASSPATH and that forms part of your complete code.
    Can java stored procedures in the database refer to libraries or class files it requires on the file system rather than the database? Is it possible to make this happen?
    Thanks

    pshiva,
    Posting the same question to multiple forums usually doesn't increase your chances of getting an answer, and it just frustrates those wishing to answer you with the result being that any future questions you post may have less chance of being answered -- because of your uncourteous, initial behaviour.
    I have answered your other thread:
    java stored procedures and referencing classes
    In my opinion, that forum (the Database JVM forum) is the most appropriate for your question.
    Good Luck,
    Avi.

  • Datastore id and flat class mapping

    Hi,
    I have
    - an abstract persistent class A with 2 concrete persistent subclasses A1
    and A2. I'm using datastore identity and flat class mapping.
    - a class B that has a field fb with a one-many mapping to A1 objects
    (Hashset).
    - a class C that has a field fc with a one-many mapping to A objects
    (Hashset).
    - an instance a1 of A1 (id = 5)
    - an instance b of B in which fb contains a1
    - an instance c of C in which fc contains a1
    When loading b and then c, i happen to have 2 instances representing a1 in
    the same persistent manager. the one loaded in b has A1-5 as ObjectId and
    the one loaded in c has A-5 as ObjectId. Thus those two objects have a
    different object id while they represents the same data.
    I would expect to find only one.
    Do you have any idea ?
    Thanks,
    Laurent Czinczenheim

    I found the problem! There is no more jdo-1.0.1.jar in the kodo rar :-)
    Czinczenheim wrote:
    I have only kodo in the rar. If i put the kodo rar 3.1.3, i can deploy it.
    if i put the kodo rar 3.2.0, i cannot and get the previous exception. Is
    there any difference in the packages used by kodo 3.2.0 (other than kodo
    packages) that could interfer with the one i could have in my jboss lib
    directories ?
    thanks
    laurent
    Stephen Kim wrote:
    Kodo should either not be in the classpath and only in the rar or
    viceversa. It still seems like a classpath issue. Can you inspect your
    kodo-jdo-runtime.jars for the existence of kodo/util/FatalUserException?
    Czinczenheim wrote:
    I have only one version of Kodo in my classpath. Therefore, when i
    replace
    the rar by the one from version 3.1.3 (or any older version), i don'thave
    any problem to deploy the kodo resource adapter.
    Stephen Kim wrote:
    It appears that you may be having classpath problems. Do you have
    multiple versions of Kodo in the classpath or ear/rar?
    Czinczenheim wrote:
    Marc,
    i wanted to try it with the new 3.2 beta version but i can't even deploy
    kodo 3.2.b1 in JBoss 3.2.3. Here is the stacktrace i get when deploying
    the rar (My kodo-ds.xml is the same as the one i used with kodo 3.1.3):
    11:47:52,975 INFO [RARDeployment] Starting
    11:47:53,036 WARN [ServiceController] Problem starting service
    jboss.jca:service=ManagedConnectionFactory,name=jdo/pmf/prisma01
    java.lang.NoClassDefFoundError: kodo/util/FatalUserException
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
         at java.lang.Class.getConstructor0(Class.java:1922)
         at java.lang.Class.newInstance0(Class.java:278)
         at java.lang.Class.newInstance(Class.java:261)
         at
    org.jboss.resource.connectionmanager.RARDeployment.startService(RARDeployment.java:533)
    >>>
         at
    org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    >>>
         at java.lang.reflect.Method.invoke(Method.java:324)
         at
    org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
    >>>
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
         at
    org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
    >>>
         at $Proxy12.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:394)
         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    >>>
         at java.lang.reflect.Method.invoke(Method.java:324)
         at
    org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
    >>>
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy4.start(Unknown Source)
         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    >>>
         at java.lang.reflect.Method.invoke(Method.java:324)
         at
    org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
    >>>
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
         at
    org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:177)
         at $Proxy18.start(Unknown Source)
         at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:231)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:632)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    >>>
         at java.lang.reflect.Method.invoke(Method.java:324)
         at
    org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
    >>>
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy6.deploy(Unknown Source)
         at
    org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
    >>>
         at
    org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
    >>>
         at
    org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
    >>>
         at
    org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
    >>>
         at
    org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
         at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    >>>
         at java.lang.reflect.Method.invoke(Method.java:324)
         at
    org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
    >>>
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
         at
    org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
    >>>
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:394)
         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    >>>
         at java.lang.reflect.Method.invoke(Method.java:324)
         at
    org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
    >>>
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy4.start(Unknown Source)
         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:632)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    >>>
         at java.lang.reflect.Method.invoke(Method.java:324)
         at
    org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
    >>>
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy5.deploy(Unknown Source)
         at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
         at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
         at org.jboss.Main.boot(Main.java:150)
         at org.jboss.Main$1.run(Main.java:388)
         at java.lang.Thread.run(Thread.java:534)
    Thanks for your help since the initial bug i described is critical forus.
    Laurent
    Marc Prud'hommeaux wrote:
    Laurent-
    I believe I have seen that problem, but I can't recall the exact
    symptoms (or the exact bug number). However, I do think that it was
    fixed for Kodo 3.2. Can you download the 3.2 beta and see if the
    problem
    still occurs?
    If it does still happen, can you provide us with your .jdo, .mapping,
    and .java files for the classes so we can take a look?
    In article <[email protected]>, Czinczenheim wrote:
    Hi,
    I have
    - an abstract persistent class A with 2 concrete persistent subclasses
    A1
    and A2. I'm using datastore identity and flat class mapping.
    - a class B that has a field fb with a one-many mapping to A1 objects
    (Hashset).
    - a class C that has a field fc with a one-many mapping to A objects
    (Hashset).
    - an instance a1 of A1 (id = 5)
    - an instance b of B in which fb contains a1
    - an instance c of C in which fc contains a1
    When loading b and then c, i happen to have 2 instances representing
    a1
    in
    the same persistent manager. the one loaded in b has A1-5 as ObjectIdand
    the one loaded in c has A-5 as ObjectId. Thus those two objects have a
    different object id while they represents the same data.
    I would expect to find only one.
    Do you have any idea ?
    Thanks,
    Laurent Czinczenheim
    Marc Prud'hommeaux
    SolarMetric Inc.
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • How to use multiple classes for each form

    Hi,
    I have created two forms using screen painter and now i want to use different classes for these two forms .
    I have declared the Sbo Connection in main class i.e. Set Application ,Connection Context() but while connecting to other classes
    for executing the code for that form SAP is not connected to that class.How to use multiple classes functionality i don't able to
    do that.Please provide some sample codes for that as it will be more helpful for me to understand.
    Thanks & Regards,
    Amit

    Hi Amit,
    In fact, its more advisable to use separate classes for every form that you use.  Have one common class, say, for eg., clsMain.cs which has all the connection and connectivity to other classes, wherein, the menu event and item event of this main class, will just be calling the menu / item event of other classes.
    The individual functionality of the child classes will be called from the item / menu event of the respective classes.
    Item event in clsMain.cs will be as below.
    private void oApplication_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
                SAPbouiCOM.Form oForm;
                BubbleEvent = true;
                try
                    if ((pVal.FormTypeEx == "My_Form1Type") && (pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD))
                        oForm = oApplication.Forms.GetForm("My_FormType", pVal.FormTypeCount);
                        NameSpace.Repots.ClsForm1.ClsForm1_ItemEvent(oApplication, oCompany, oForm, ref pVal, ref BubbleEvent);
                    if ((pVal.FormTypeEx == "My_Form2Type") && (pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD))
                        oForm = oApplication.Forms.GetForm("My_FormType", pVal.FormTypeCount);
                        NameSpace.Repots.ClsForm1.ClsForm2_ItemEvent(oApplication, oCompany, oForm, ref pVal, ref BubbleEvent);
    Now, in the individual classes, you can have their respective item events, which will be called from the main class, and the respective functionalities will occur.
    Hope this helps.
    Regards,
    Satish.

  • Multiple classes in one file bad?

    Hello.
    I've been coding a load of elements recently, one of which is HUD elements for a game. I separated each element (joystick, fuel gauge etc) into a separate class but in one file, by that I mean more than one implementation in a file. Is this bad practise? Should I use one class and simply write methods that return an element, or is it ok to split them up?
    To me, in my head ,it makes more sense to split the up. I just wonder if this is bad practise?

    I did some reading and decided not to use multiple classes in one file, and instead use methods.

  • Tag Libraries : multiple classes for same tag

    Hi ,
    I have a tag library like this
    <tag>
    <name>process</name>
    <tagclass>packagea.page1</tagclass>
    <attribute>
    <name>name</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    I have 15 tags like this with the same 'process' name but ofcourse different tagclass files (corresponding to 15 different PAGES)
    Now, while the container encounters the tag on any PAGE (all the tags on all the PAGES will have the same prefix 'process'), how will the container know which class file to pick from out of the 15 different class files ???
    does this happen sequentially or is there some mechanism of caching within the container ... ??

    probably it takes the first, if it's not throwing an exception about it. You should have 1 tag library and multiple tags which should have separate names, not separate tag libs with 1 tag each.

  • PM : Does PM support multiple  Class types for Equipment classification

    Hi,
        Do  Plant maintenance support multiple class types for the classification for the equipments.
    Our  Customer has created his own class type other than 002(Equipment) for the classification and wants to know weather PM supports such class types or not.
    Thanks and Regards,
    Anuj
    Edited by: Anuj Goyal on Mar 13, 2008 10:16 AM

    hi
    i think you can use the your own class type provided you have done all the settings related to the standard class type 002,also if you have create your class type your standard class type will be changed to either the newly created one or 002 based on settings made by you
    regards
    thyagarajan

  • Why do I get multiple class files from 1 java file?

    I wrote a dialog box using gridBagConstraints and another program RunPanel to run it as a java application. For the first time since playing with java, I get multiple class files from a single java file.
    This seems very strange to me and wonder if anyone else has come across this and what could possibly be the reason for it. I did a clean (in Eclipse) just to make sure it wasn't garbage and sure enough they come back again.
    I have ReconPanel.java from which I get ReconPanel.class with the addition of ReconPanel$N.class where N goes from 1 to 5.
    The same thing in RunPanel but here there is only 1 extra file, RunPanel$1.class.
    I'll include the code for RunPanel since it is relatively small:
    package ilan;
    import javax.swing.JFrame;
    public class RunPanel extends JFrame {
         private static final long serialVersionUID = 1L;
         private ReconPanel m_reconPanel = null;
         public RunPanel() {
              super();
              initialize();
          * This method initializes this
         private void initialize() {
            this.setTitle("tester");
            this.setSize(new java.awt.Dimension(138,396));
            this.addWindowListener(new java.awt.event.WindowAdapter() {
                 public void windowClosing(java.awt.event.WindowEvent e) {
                      m_reconPanel.exitPanel();
                      System.exit(0);
              m_reconPanel = new ReconPanel();
              this.getContentPane().add(m_reconPanel);
          * @param args
         public static void main(String[] args) {
              JFrame frame1 = new RunPanel();
              frame1.setVisible(true);
    }  //  @jve:decl-index=0:visual-constraint="10,10"The only thing "unusual" I do is to put a listener on the WindowClosing so that I can go back to ReconPanel and write results to the registry.
    Can anyone tell me what is going on?
    Thanks,
    Ilan

    He IIan,
    Yes, you get number of extra class files based on your number of anomyous class es used. Like in your RunPanel, you get only 1 ..$1.class file, b'coz u have used only 1 annomyous class & i.e WindowAdapter. Take a look at this code :-
    this.addWindowListener(new java.awt.event.WindowAdapter() {
                 public void windowClosing(java.awt.event.WindowEvent e) {
                      m_reconPanel.exitPanel();
                      System.exit(0);
            });Similarly, in your ReconPanel, you must have used such kind of classes 5 times, & hence u get such 5 extra classes. To avoiod such extra classes, if you can directly implement that interface or extend the class, if possible will be best. For example, for each button, u write
    button1.addActionListener(new ActionListener() {
    // Code
    });Instead, of this, its better to implement ActionListener & write
    button1.addActionListener(this);
    public void actionPerformed(ActionEvent ae) {
       if (ae.getSource() == button1) {
       // CODE
       }Likethis, you can get rid of such numerous extra class files. In IDE, if you ask to add actionEvent, it will do the first method. To get rid of it, don't add event in the properties, instead, apply the second method. The same thing applies for anyother event. The first option is worthful, if by implementing, u got to write 5 functions from which u r gonna use just 1 method.
    Hope this clears your question.
    Trupti

  • Anchor point used in drawImage() of  Graphics class

    Hi all,
    This is sourab.I need to know about the concepts of anchor point used in drawImage() of Graphics class.We all know in drawImage() method has four co-ordinates.First one is for Image name,second one is for x coordinate ,third one is for y coordinate and the final one is for anchor point.Actually anchor point will place the image in the corresponding position.Now my doubt is what is the purpose of x,y coordinates.
    Also i want some links to learn about this anchor point concepts.Can anyone provide solution to me ASAP.
    Regards/Thanks,
    Sourab

    We all know in drawImage() method has four co-ordinates. [co&ouml;rdinates?]http://java.sun.com/javase/6/docs/api/java/awt/Graphics.html
    Or 5 or 6 or 7 or 10 or 11. And if you include Graphics2D:
    http://java.sun.com/javase/6/docs/api/java/awt/Graphics2D.html
    There is second one taking 4 arguments, and one taking 3.

Maybe you are looking for

  • Can I copy from a PDF on iPad and paste in pages?

    I want to copy some text from a few PDF files and then save them as a pages doc - is there an app that will allow me to do this? I've tried using iBooks but I can't seem to do it!

  • Webdynpro Version Q & A

    Hello expert I am new to webdynpro and please assist me. 1. How I want to check the version of webdynpro? 2. How I want to determine whether the webdynpro is in abap or java? Thanks! A. Joker.

  • Removing items from memory using loop

    The following for loop removes children from their parent if they're in the display list. It works correctly, but I also want to remove each child from memory with the same loop. I can't get it to work correctly however.

  • Standby DB creation

    HI all, I have 'Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod' installed, I want to create one standby DB through EM Dataguard Manager, but it is not available in EM. Even the DGMGRL command also not working. As I know Dataguard fe

  • How to export BIAR from reports?

    Hello,everyone! I want to migrate the reports form my local BO server to another BO server,My ideas are: First,I export my local BO reports to BIAR file format. Second,use import wizard import the BIAR file into another BO server. But,I can't know ho