How to Refer a class of Model Layer From a Class of View Layer IN Struts?

HI There !
I am building an application on struts using JDeveloper 10.1.3.1. On Selecting New application and writing few classes this is my Application Hierarchy is like folowing:
Application Name
|___ Model (Project given by Jdeveloper)
| |_____ Application Resources
| |________ model (Package)
| |__________ CheckUser.java
| |__________ DataAccess.java
|
|___ ViewController(Project given by Jdeveloper)
|________ Application Resources
|__________ View (Package)
|__________ logon.java
I tried to use CkeckUser.java in logon.java by importing the package model.
But Jdeveloper is showing an error which means that this Package is not available here.
So then how I can refer this class at View layer classes.

Hi Ankur,
I'm facing the same problem, i need to access a method in the AppModuleImpl but when i try to call it from an action in my viewController this error pops out:
Error: cannot access class oracle.jbo.server.ApplicationModuleImpl; file oracle\jbo\server\ApplicationModuleImpl.class not found
Did you have some advances with this?
Please let me know
Thanks

Similar Messages

  • Can I invoke a class that extends JAppl from another class extends JAppl

    Can I invoke a class that extends JApplet from another class that extends JApplet. I need to invoke an applet then select an action which opens another applet. Thanks in advance.

    Nobody is able to solve this problem, i cant even
    think this things. i have hope so plz try and get
    result and help.Did you understand what Sharad has said???
    Yep, you can forward to specific error page from servlet when even error occured in JSP. In order to achieve you have to open jsp file from servlet say example by using reqdisp.forward.
    handle exception in the part where you are forwarding. And forward to the specific error page inside catch block.

  • How to move the contents of an itab from one class to another...

    Hello Experts,
    How can I move the contents of an internal table for a given class to another class.
    I want to transfer the contents of my internal table lt_vbak to another class
    which is lcl_get_docflow. Below is my code:
    REPORT  zsd_orderstage
            NO STANDARD PAGE HEADING.
    * Data Dictionary Table/s                      *
    TABLES: vbak.
    * Global Structure/s                           *
    TYPES: BEGIN OF t_output,
            salesgroup    type vbak-vkgrp,
            salesorder    TYPE vbak-vbeln,
            custcode      TYPE vbak-kunnr,
            shipto        TYPE likp-kunnr,
            creation_date TYPE vbak-erdat,
            created_by    TYPE vbak-ernam,
            delorder      TYPE likp-vbeln,
            invnumber     TYPE vbrk-vbeln,
           END OF t_output.
    * Global Internal Table/s                      *
    DATA: gt_output TYPE STANDARD TABLE OF t_output.
    * SELECTION-SCREEN                             *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:     p_kunnr TYPE vbak-kunnr OBLIGATORY.
    SELECT-OPTIONS: s_group for vbak-vkgrp,
                    s_auart FOR vbak-auart,
                    s_erdat FOR vbak-erdat  OBLIGATORY,
                    s_ernam FOR vbak-ernam.
    SELECTION-SCREEN END OF BLOCK b1.
    *       CLASS lcl_main DEFINITION
    CLASS lcl_main DEFINITION ABSTRACT.
      PUBLIC SECTION.
        TYPES: BEGIN OF t_vbak,
              vbeln TYPE vbak-vbeln,
              erdat TYPE vbak-erdat,
              ernam TYPE vbak-ernam,
              auart TYPE vbak-auart,
              kunnr TYPE vbak-kunnr,
              vkgrp type vbak-vkgrp,
             END OF t_vbak.
        TYPES: BEGIN OF t_vbfa,
                vbelv   TYPE vbfa-vbelv,
                vbeln   TYPE vbfa-vbeln,
                vbtyp_n TYPE vbfa-vbtyp_n,
               END OF t_vbfa.
        TYPES: BEGIN OF t_likp,
                vbeln TYPE likp-vbeln,
                kunnr TYPE likp-kunnr,
               END OF t_likp.
        TYPES: BEGIN OF t_vbrk,
                vbeln TYPE vbrk-vbeln,
               END OF t_vbrk.
        DATA: gt_vbfa     TYPE STANDARD TABLE OF t_vbfa,
              gt_likp     TYPE HASHED TABLE OF t_likp
                          WITH UNIQUE KEY vbeln,
              gt_vbrk     TYPE HASHED TABLE OF t_vbrk
                          WITH UNIQUE KEY vbeln,
              gt_delivery TYPE STANDARD TABLE OF t_vbfa,
              gt_invoice  TYPE STANDARD TABLE OF t_vbfa.
    ENDCLASS.                    "lcl_main DEFINITION
    *       CLASS lcl_get_so DEFINITION
    CLASS lcl_get_so DEFINITION INHERITING FROM lcl_main.
      PUBLIC SECTION.
        DATA: lt_vbak TYPE STANDARD TABLE OF t_vbak.
        METHODS: get_sales_orders
                    RETURNING
                       value(re_vbak) TYPE t_vbak.
    ENDCLASS.                    "lcl_get_so DEFINITION
    *       CLASS lcl_get_so IMPLEMENTATION
    CLASS lcl_get_so IMPLEMENTATION.
      METHOD get_sales_orders.
        SELECT vbeln erdat ernam auart kunnr vkgrp
          FROM vbak
          INTO TABLE lt_vbak
         WHERE erdat IN s_erdat
           AND ernam IN s_ernam
           AND auart IN s_auart
           AND kunnr = p_kunnr.
      ENDMETHOD.                    "get_sales_orders
    ENDCLASS.                    "lcl_get_so IMPLEMENTATION
    *       CLASS lcl_get_docflow DEFINITION
    CLASS lcl_get_docflow DEFINITION INHERITING FROM lcl_main.
      PUBLIC SECTION.
        DATA: lt_vbfa TYPE STANDARD TABLE OF t_vbfa.
        METHODS: get_subsequent_docs
                    IMPORTING
                       value(im_vbak) TYPE t_vbak
                    EXPORTING
                       ex_vbfa TYPE t_vbfa.
    ENDCLASS.                    "get_docflow  INHERITING FRO
    *       CLASS lcl_get_docflow IMPLEMENTATION
    CLASS lcl_get_docflow IMPLEMENTATION.
      METHOD get_subsequent_docs.
      ENDMETHOD.                    "get_subsequent_docs
    ENDCLASS.                    "get_docflow IMPLEMENTATION
    * Global Internal Table/s                      *
    START-OF-SELECTION.
      DATA: o_get_so      TYPE REF TO lcl_get_so,
            o_get_docflow TYPE REF TO lcl_get_docflow.
      CREATE OBJECT: o_get_so,
                     o_get_docflow.
      CALL METHOD o_get_so->get_sales_orders.
    What I want is to pass the records of lt_vbak to method get_subsequent_docs. How do I do this guys?Thank you and take care!

    .

  • How to refer to J2EE library server component from a web service?

    Hi,
    I need help!  I created a web service and it worked fine.  However, I started having problems when I tried to use java classes from my deployable J2EE library server component.  I got the NoClassDefFound error.
    I tried to include the library DC in the Used DC list and put the reference of it in the web service deployment descriptor xml (application.xml and application-j2ee-engine.xml), but it did not work.
    How do I refer and use java classes from my deployable J2EE library at run time from my web service application?  What should I do?
    Thanks,
    Giavinh Pham

    I would like to clarify more about the web service project.  I created a Java DC project and converted it into a web service as the SAP manual instructions.  It worked fine by itself, but I now want to use some of my classes that I deployed as a J2EE library server component. 
    It was compiled and built when I refer to my J2EE library server component DC in the UsedDC.  It was deployed fine as well.  However, it broke when I tested the web service calls.  The class declarations and usage from the J2EE server component could not be found (NoClassDefFound error.) 
    I thought it was because I did not have an application-j2ee-engine.xml in my META-INF folder so I created one and referred to the library in xml as type library and reference 'strong'.  I built and deployed again.  It still did not work. 
    I examined the EAR and noticed that there were two parts of the EAR.  One is the WSAR archive file that contains the META-INF folder from my project and other web service assemblies.  The other part is the META-INF folder generated by the SAP NetWeaver IDE. 
    The strange thing was that SAP NetWeaver IDE generated an application-j2ee-engine.xml without any reference to my J2EE library server component.  However, the nested application-j2ee-engine.xml in the WSAR archive file did contain the info. 
    Since I cannot control the application-j2ee-engine.xml generated by SAP NetWeaver IDE, what should I do?  Is it the cause for my problem?
    Please advice, anyone?
    Giavinh

  • How to use a method in sequence diagram from a class diagram

    Hello, can someone tell me how to use the method from class diagram in sequence diagram? so far i only can add a classifier to the object lifeline but i still cannot add the method from the class...
    thx

    Now that Web Services is around, I'd look at possibly implement a Web Service call in your applet, which can then be given back any object(s) on return. Set up your server side to handle Web Service calls. In this way, you can break the applet out into an application should you want to (with very little work) and it will still function the same

  • How To Change Resource Bundle file's data from Java Class

    Hi
    i have used below code for accessing Resource Bndle from Java Class but here i also want to make change in a particular key and its value.
    please let me know the code i should use to make changes in Resource Bundle file's key and value and saving the same in the file.
    package test;  import java.util.Enumeration;
    import java.util.ResourceBundle;
    public class ResourceBundleTest {
    public static void main(String[] args) {
    ResourceBundle rb = ResourceBundle.getBundle("test.bundletest.mybundle");
    Enumeration <String> keys = rb.getKeys();
    while (keys.hasMoreElements()) {
    String key = keys.nextElement();
    String value = rb.getString(key);
    System.out.println(key + ": " + value);
    Thanks

    With further debugging, I noticed the following line only works in integrated WLS but not in standalone WLS
    resourceBundle = ResourceBundle.getBundle("com.myapp.MyMappings");
    I confirmed the corresponding properties file was included properly in the EAR file but the standalone WLS failed to find the properties file at runtime.
    Why did the standalone WLS class loader (must be the same as the integrated WLS) failed to find the properties file deployed under the WEB-INF/classes path in the EAR file?
    The above line was in a POJO class which has the same classpath as the properties file ie. com.myapp.MappingManager.class.
    It was strange that the class loader could load the POJO class but unable to find the com.myapp.MyMappings.properties in the same classpath!!!
    Is this a bug in standalone WLS?
    Edited by: Pricilla on May 26, 2010 8:52 AM
    Edited by: Pricilla on May 26, 2010 9:01 AM

  • PROBLEM IN ACTIVATION OF A CLASS WHICH IS COPIED FROM STD CLASS

    Hi All,
             I have a problem in activating a class which is copied from the standard class.
    std class: CL_GUI_FRONTEND_SERVICES
    The class has got some protected methods and attributes.
    here i'm getting following error whenever i try to activate the class:
    1) access to protected method "CALL METHOD" is not allowed.
    2) access to protected attribute "H_CONTROL"  is not allowed.
    Thanks & Regards,
    Deepak

    hi,
    i am not sure abt d way u hv coded, but there are some basic stuffs wic need to be taken care of:
    1: access 2 protected methods are allowed by self class or its inherited classes. it ca't e accessed from outside class. also protected methods can b accessed from FRIEND class. please use inherited class objects to access protected attribute or methods...
    2: also i have found that class implementation or declaration or method declaration can't be done inside PERFORM routines... try to avoid using forms.....
    more info can be given if i get the exact code..
    regards,
    ags.

  • How to refer to an IB controller instance from code???

    Hi all. I know this must be simple but I have just never run into this before.
    When you drag an array controller from IB's palette into your top-level window, it instantiates it, right? All well and good - it's controlling my array and updating the tableView that is bound to its arrangedObjects just fine.
    Now I want to refer to it (the instance of the controller) from code. I have its class files, VoteeController.h and .m, but since I didn't make the instance, I don't know how to reference the instance. What I want to do is get the selection of the controller. That's all!
    I cannot code mySelection = [VoteeController selectedObjects], because that is a class object.
    How do I refer to the instance of this controller that IB instantiated when I dragged it onto the main window??
    I have the model object, playersArray, which has the data but doesn't have the selection since it is not a controller. I need to get the selected objects of the array controller that I made in IB.
    Thanks for any help!!

    Yes, I found a way to do it. So I am glad I can help. I will paste in the notes I took for myself.
    Ask any questions if the notes are not clear or do not work for you.
    NOTES:
    Settings for IB:
    TextModel NSObject:
    Class: TextModel (same as @interface)
    TextViewController Object Controller:
    Connections: content to TextModel
    Class: NSObjectController
    Bindings: none
    Content: control-dragged to TextModel.
    Keys: testString
    NOTE: Also works with no connection but setting in Bindings of Bind To Controller: TextModel, "blank" Controller Key and Key Path of self. ("TextModel.self") as Controller Content Content Object.
    NSTextView:
    Controller: TextViewController
    Connections: none
    Bindings:
    Controller: TextViewController
    Controller Key:selection
    Key Path: testString
    SUMMARY:
    1) Model Object - no connection needed. No keys needed. Just enter the Class name in the ID field (the Class name is the name of the Class whose instance contains the getters and setters for the object you want this Model Object to represent).
    2) Controller Object -
    A. Leave Class alone unless it makes new objects.
    B. No connections.
    C. Use Attributes panel to enter keys for the objects in the Model that you want.
    D. Bindings: bind to the Object Model. Leave the Controller Key blank and enter "self" in the Model Key Path.
    3) View Object -
    A. Leave Class alone (NSTextView)
    B. Turn off all RTF options if plain text.
    C. No connections.
    D. Bindings: bind to the View Controller. Set the Controller Key to Selection and the Model Key Path to the model key (e.g., testString).
    Now I've screwed up my Array->Two Array Controllers -> Two Table Views so they don't work any more. I had them working but with what I considered kludges (my goal in this project is to learn the BEST way to use Cocoa Bindings so as to have the absolute minimum glue code - I am aiming for the learning process, not a result necessarily - I already have a completely functional app in AppleScript Studio so I am under no "deadline."
    I had it working using your solution and setting some connections (control-drag) also, but I wanted to redesign it and not have to use connections (notice the TextView rules I posted above use no connections at all - only bindings).
    So if anyone reading this knows how to connect a single array as the Model to two NSArrayControllers as the Controllers, and the Controllers to two TableViews as the Views, chime in. I thought I had it down but it just doesn't load the array into the tableView. As usual, the array has its 7 elements in the debugger and in the NSLogs that I do.
    The part that keeps confusing me is that you have to set a class name for each IB element, and I don't want to have a bajillion Class files. I want one or two general Classes that can contain both an array and some strings and booleans and so forth - and I still cannot find the way to access an IB instance from code except the IBOutlet solution you provided. If that's the only way, fine; but I wanted to see if there is another way using Bindings. SURELY people who declare arrays need to obtain the selection for the arrays, and that exists ONLY in the Controller. So are we supposed to interact with the Controllers or not? How to get a controller's selection and use it on your Model array so you can manipulate with it? The controller instance doesn't even have a name.
    Anybody know anything about FIle's Owner? Several of the examples say to connect something to File's Owner but never say why. If File's Owner has access to all properties of the whole project, that would explain why it is used so often. But I do not think that is the case.

  • Reflection: how to get the name of a subclass from parent class?

    Suppose I have a parent class P and two subclasses S1, and S2. There's another method which has an argument of type P. Inside this method, I want to inspect the object (of type P) passed in and print its name, such as "S1" or "S2". How do you do that? I tried Class.getSimpleName(), but "P" is returned no matter which subclass objects you have. Thanks:)

    That's the same as you said last time, and I'm telling you that's not what happens when I test it:
    public class Parent {
    public class SubclassOne extends Parent {
    public class SubclassTwo extends Parent {
    public class TestGetName {
      public static void main(String[] argv) {
        showNames(new SubclassOne());
        showNames(new SubclassTwo());
        showNames(new Parent());
      private static void showNames(Parent p) {
        System.out.println("Name: " + p.getClass().getName());
        System.out.println("Simple name: " + p.getClass().getSimpleName());
        System.out.println("Canonical name: " + p.getClass().getCanonicalName());
    }prints:
    Name: SubclassOne
    Simple name: SubclassOne
    Canonical name: SubclassOne
    Name: SubclassTwo
    Simple name: SubclassTwo
    Canonical name: SubclassTwo
    Name: Parent
    Simple name: Parent
    Canonical name: ParentYou must be doing something else that you're not saying. Either that or you're expressing yourself very poorly. Why not post a simple, self-contained, compilable example of what you claim is happening?

  • How to refer the work order status value from a different transaction in the step handler?

    Hi All,
    I have a requirement to check the status of the work order from a different transaction before doing some logic in the current transaction. The following transactions are done to replicate the issue
    1)changing the status to ONSITE to edit the work order (transaction 1)
    2)Adding some information which will do some logic (transaction 2)
    3)Completing the work order (transaction 3)
    The transaction 2 will have some logic and will be executed only if the status is COMP but even though the status is COMP now (transaction 3) my condition check in the logic is showing as ONSITE status(transaction.status=ONSITE) and it fails. How can i get the latest status of the work order in the device? Please advice

    Hi Jason,
    The CompleteWorkOrderFinish sub action does have Apply action (screenshot 1) and the transaction definition (screenshot 2)of CompleteWorkOrderFix transaction with the only property Status which has the following settings (screenshot 3)
    Also I am trying to add a status property in EditMeterFitDetaisl transaction and update this value with the current status of the work order using object collections filtering with key value. Please let me know if that approach can be followed. Thanks

  • How do I cancel a tabular model table from being validated?

    I made the mistake of clicking validate on the edit table properties window and it has been running for about 15 minutes now. I've tried everything short of killing VS in task manager. What is this thing doing that takes so long? And why can't I stop it?
    But if I change the query and it executes I get a link in the progress window to cancel...

    Hi Developer,
    If I understand correctly, you click "OK" button by mistake after made some changes on the table, then it had been running for about 15 minutes and still not complete, now what you want is that cancel this operation, right?
    As per my understanding, if we click the "OK" button on Edit Table Properties, then Analysis Services will process this table and update it to tabular model. If this table contains large data, this operation can take long time. If we click the "Ok" button
    by mistake, we can click "cancel" to cancel this operation. And there will be a message said that "The operation was cancelled by the user".
    In your scenario, you said that you killed VS in task manager, what' happen when you reopen the tabular project? The operation might be cancelled since you killed VS in task manager during processing.
    If I have anything misunderstood, please point it out.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Loading XML using a custom class and accessing it from other classes?

    I began with a class for a movie clip rollover function
    FigureRollOver. It works marvellously. Three things happen:
    1) it loads XML from a file "mod1_fig1.xml" and uses another
    class, XMLMember, to retool the scoping of the XML so that I can
    get at it
    2) an onload call inside of XMLMember calls the myOnLoad
    function and transfers the XML into an array.
    3) so long as the array is finished building, rolling over a
    movie clip attaches a new movie clip with the rollover text in it.
    But I don't want all those functions in one because I need it
    to be more dynamic, starting with being able to load any old xml
    file instead of just "mod1_fig1.xml", plus it seems like
    overbuilding to have all of that in one class, so I've separated
    out the loading of the XML and building of the array into its own
    class, FigureXMLLoader. FigureRollOver is then left to just attach
    the rollover with text in it, extracted from the array built by the
    new class.
    Problem is, though the array builds inside FigureXMLLoader, I
    can't figure out how to make it available outside the class. I know
    that I'm constructing things in the wrong order, and that the array
    needs to be somehow built inside the class function to be
    available, but I can't figure out how to do that. A cruddy
    work-around is to put a function call at the end of the building of
    the array, which calls yet ANOTHER function on the main timeline of
    my .swf to put the array I've just built into a new variable. This
    works, but it's messy. It seems like I should be able to have one
    line of script in the .swf that generates an array on the main
    timeline (or just a public array) which I can then access from my
    FigureRollOver class:
    var myRollOvers:Array = new FigureXMLLoader("mod1_fig1.xml");
    Here is FigureXMLLoader (see comments in the code for more
    details) which obviously does not return an array as it is, because
    of all the working around I've had to do. Note the "testing"
    variable, which can be traced from the main timeline of the .swf,
    but I will get "not what I want" because of course the array hasn't
    been built yet, and never will be, inside of the declaration as it
    is. How do I get it in there so I can return an array?
    Thanks!

    Suggest you ask this question in the Actionscript forum as
    this forum is
    more tuned to database integration questions.
    You can create arrays outside a class and pass them into it
    by reference and
    visa versa build arrays inside a class and pass out via
    reference.
    The preferred approach is to place the array in a class and
    not expose it.
    Then add methods to use the array or should we say to use the
    class.
    Lon Hosford
    www.lonhosford.com
    Flash, Actionscript and Flash Media Server examples:
    http://flashexamples.hosfordusa.com
    May many happy bits flow your way!
    "maija_g" <[email protected]> wrote in
    message
    news:ed4i43$9v0$[email protected]..
    > Update: I've now put this on the main timeline of the
    .swf:
    >
    > myRollOversLoaded = false;
    > var myRollOvers:Array;
    > var roll_content = new FigureXMLLoader("mod1_fig1.xml");
    >
    > And inside the "myOnLoad" function in FigureXMLLoader,
    just after the
    > while
    > loop I've put this:
    >
    > _root.myRollOversLoaded = true;
    > _root.myRollOvers = figure_arr;
    >
    > The movie clip rollover won't act until
    myRollOversLoaded is true. It
    > works,
    > but it still seems klugey. Any suggestions for a more
    elegant solution
    > would be
    > appreciated.
    >

  • How to pass the selected table row data from popup to source view

    Hi ,
    I have requirement of passing the data from popup view to source. , searching some data in  popup view and displaying in table,
    Like i am passing some input and click search button will display the data in table, when select any of the row in the table and click on the another button , i should be able to pass the select row to the source view and also should close the popup.
    When i implement , In the popup windiw, when i enter the customer no, and click on search button, it is closing the popup itslef. not able to see the data in popup.
    Can u tell me what is that soultion.
    Regards
    Vijay

    Hi Harsimran
    Thanks for the reply,
    1) Source view
    In  "Source View" i have input field called Customer_no. But,  the end user will not have any idea , what customer no to enter. so i am searching the customer no in the popup view.
    1) Customer_no( This is an inputfiled , to get the customer no from the popup view)
    2) Get Customer NO( This is a button to call the popup view)
    "Get Customer NO" This button action will open the popup view.
    In this popup, i have
    1) Input field (To enter the search term)
    2) Search (To seach the customer no based on the search term)
    3) Table ( To display the search data)
    4) Button in Table tool bar called "Select" .( To close the popup view after selected the required data in the table to pass it back to the source view).
    so in the popup view what happening is, when i click on the search button itself , it is closing the popupview  by transfering the first row of the tbale ,with out select the required row in the table.
    i need to close the window after click on the "Select" button in the toolbar , after selected the required row data to trasfer in the table.
    Can u pelase tell me what are the modifcations i need to do it.
    Regards
    Vijay

  • How to add objects to panel in one class from another class

    Hi this is what i am trying to do. I have a drag and adrop tool working where the users and select objects on a small panel and drag them to another panel called the tpan. What i want to do is create another class, which creates objects and now i want to display these objects on the tpan. So say i have a class DisplayTpan(), this class is used to display the objects which have been dragged from the small panel, and objects on this panel have mouselisteners attached, so that these objects can be moved around on the tpan. I have created another class called creatObj(), and from this class i want to add objects to the tpan. The DisplayTpan class extends a Jpanel, would this be he case for the CreateObj() class? In the CreateClass i have made a call to DisplayTpan t = new DisplayTPan();
    t.add(object);
    But this does not add the object to the panel, any ideas on how it should be done?
    Problem number two i have is say, I have two objects created on that oanel, i now want to draw a line t connect the two objects, this is just simply a call to the drawLine function but how would it be possible to add a ,mouselistener to that line, so it can be extended moved around etc? Any help much appreciated thanks.

    Try to convert the PL/SQL code from Forms trigger into a PL/SQL library(.PLL),
    and then attach that PLL in your forms.
    Note that all Forms objects should be referenced indirectly, for example,
    you have to rewrite
    :B1.DEPT_CODE := :B2.DEPT_CODE;
    :B3.TOTAL_AMOUNT := 100;
    ==>
    copy('B2.DEPT_NO','B1.DEPT_NO');
    copy('100','B3.TOTAL_AMOUNT');
    This is the best way to share PL/SQL code among Oracle Forms.

  • How to add objects to panel from another class?

    Hi this is what i am trying to do. I have a drag and adrop tool working where the users and select objects on a small panel and drag them to another panel called the tpan. What i want to do is create another class, which creates objects and now i want to display these objects on the tpan. So say i have a class DisplayTpan(), this class is used to display the objects which have been dragged from the small panel, and objects on this panel have mouselisteners attached, so that these objects can be moved around on the tpan. I have created another class called creatObj(), and from this class i want to add objects to the tpan. The DisplayTpan class extends a Jpanel, would this be he case for the CreateObj() class? In the CreateClass i have made a call to DisplayTpan t = new DisplayTPan();
    t.add(object);
    But this does not add the object to the panel, any ideas on how it should be done?
    Problem number two i have is say, I have two objects created on that oanel, i now want to draw a line t connect the two objects, this is just simply a call to the drawLine function but how would it be possible to add a ,mouselistener to that line, so it can be extended moved around etc? Any help much appreciated thanks.

    As for your first problem...too confusing...too tired...mb tomorrow it will make sense :)
    Fer the second...no need to add a mouse listener to each line. There are a couple options that spring to mind, the easiest I can think of is just check to see if the mouse click intersects with any of the lines (bit of geometry).
    The second, ugly but a hella allot more accurate and better (me thinks), is to create a bounding box around the line, so the user doesn't have to click right right on the line. I created this bounding box by painting the pixels with a special key to correspond to that line. The other nice thing about this key is the fact that the lookup is quick.
    The first step was the create a array of integers the size of the surface. Whenever a line is drawn on the graphical surface, do a corresponding line in the integer array, and create the bounding box inside this invisible array. Now whenever the user clicks just do a lookup into this array and check to see which line was selected...then go to town.
    If you want a more detailed explination, i'll post some code later.

Maybe you are looking for

  • How do i stop sharing my mac pro with my mac air

    how do i stop sharing my mac pro with my mac air?

  • Export Html in Keynote does not include hyperlinks when exported as HTML

    I created a new keynote doc, and new page added an simple image added a link > to my image using the hyperlink option the preview section shows the link and i am able to click the link that takes me to the domain or subdomain added. the problem is wh

  • What is better than WAP 200

    HI, I have a small business, i use to have an Access Point from another brand, I had a lot of problems using it like every time it looks like it freeze, I can see the wireless but I don't get internet access from it, and I need to reboot it to fix th

  • IVR Gateway is receiving "False Calls"

    We are implementing a IVR system across our network, and have over 30 sites converted and in Production. One office is giving us problems in the fact that after they close for the day, their IVR gateway starts receiving calls that appear to have a re

  • Itunes songs not playing in library

    Some songs will not play on computer from library. Comes up as cannot find the songs. Please help - Have reinstalled itunes & still will not work Thanks Tibley