Design question: Link data between JFrames

Dear all,
I have a design question. I have this form in a JFrame where you can set an icon as a property. To achieve this, I have a "Set" button on the form which will open a new window with all the available icons. When you click an icon, I want the "icon" frame to be closed and the selected icon to be send to the original form. This is the way I do it now:
Interface :
public interface IconUpdate
public void updateIcon(Icon icon);
}Main frame with the "Set" button:
public class Test extends JFrame implements IconUpdate, ActionListener
    private Icon icon = null;
    public Test()
        // add button and actionlistener and that kind of stuff
    public void actionPerformed(ActionEvent e)
        if(e.getSource() == btnSetIcon)
            new IconFrame(this);
    public void updateIcon(Icon icon)
        this.icon = icon;
}The Icon frame:
public class IconFrame extends JFrame implements ActionListener
    IconUpdate parent = null;
    public IconFrame(IconUpdate parent)
        this.parent = parent;
        // Initialize table,"Pick" button etc.
    public void actionPerformed(ActionEvent e)
        if(e.getSource() == btnPick)
            parent.updateIcon((Icon)list.getSelectedValue());
            this.dispose();
}Maybe I made some spelling faults, but this is the way I implement it. Now my question is: is there another way to achieve my goal? If I have to create an interface for every "popup choose dialog" in my program, I have to create many of them. I know using a combobox in the main frame is an option, but I just want to use it this way. Can anyone tell me how I can rewrite this code to make it better / more professional?
Tx in advance!!!
Peter

I can think of a couple options:
1) Let IconFrame's constructor accept a Test parameter, instead of creating an interface.
2) Make IconFrame into a modal dialog & have it store the user's selection in a variable. Then when you show the dialog, your action listener will block until the user selects an icon. Then you can call "getSelectedIcon()" to retrieve his/her selection. This would be much like the JOptionPane.showXXX() methods, and probably the cleaner solution.

Similar Messages

  • Design Question - Export Data via APD

    Hello gurus,
    I have following screanrio where I need your help / evaluation.
    Query based on Multicube. Result of this query should be exported automatic to ftp server.
    I thought about create an APD which export data to ODS. And then via programm read content of ods and export to ftp server.
    Any other idea?
    Can anyone provide me coding samles for export of data to ftp? Thanks in advance.

    Hi Starwars,
    You can export the report extracts from RSCRM_BAPI t-code.
    The other requirement can be very well achieved by APD.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/5047160e-3559-2e10-d193-bbb987df7dd2
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0980b4c-7058-2e10-45be-c67712b499c6
    Regards,
    Suman

  • Data between mxml components

    I have a question about data between mxml components.
    Product.mxml is the overview screen for the products and ProductDetail.mxml (it is a TitleWindow) the detail screen.
    In the Product I define a value object ProductVo with all the data. When I click a record in the overview and click the button 'change' (changeProduct function) then a popup window appears with all the data in it.
    Code in Product.mxml:
    [Bindable]
    public var myWin:ProductDatail;
    private function changeProduct():void {
      myWin = PopUpManager.createPopUp(this, ProductDetail, true) as ProductDetail;
      myWin["btnSave"].addEventListener("click", save);
    private function save(event:Event):void {
      productVo.productId = myWin.ti_productnr.text;
      productVo.name = myWin.ti_name.text;
      productVo.ean = myWin.ti_ean.text;
      ...some code to save the data in the db...
    Code in ProductDetail.mxml:
    [Bindable]
    public var productDetailVo:ProductVo;
        <mx:Form>
            <mx:FormItem label="Productnr" required="true">
                <mx:TextInput id="ti_productnr" text="{productDetailVo.productId}" width="60"/>
            </mx:FormItem>
            <mx:FormItem label="Naam" required="true">
                <mx:TextInput id="ti_name" text="{productDetailVo.name}" width="200"/>
            </mx:FormItem>
            <mx:FormItem label="Ean">
                <mx:TextInput id="ti_ean" text="{productDetailVo.ean}" width="100"/>
            </mx:FormItem>
            <mx:FormItem direction="horizontal">
                <mx:Button id="btnSave" label="Save"/>
            </mx:FormItem>
        </mx:Form>
    So my question: the save function in Product.mxml, is it possible to do this in a easier way instead of linking all the data from the form into the value object? Something like productVo = myWin.productDetailVo, but that does not work.

    I just looked at the parsley framework and saw this code:
    private function save():void
    contact.firstName = firstName.text;
    contact.lastName = lastName.text;
    contact.email = email.text;
    service.save(contact);
    So, it is doing the same thing I'm doing.
    I'm using Spring and hibernate on the server level, it is my own framework.

  • SOA real-time design question

    Hi All,
    We are currently working with SOA Suite 11.1.1.4. I have a SOA application requirement to receive real-time feed for six data tables from an external third party. The implementation consists of five one-way operations in the WSDL to populate the six database tables.
    I have a design question. The organization plans to use this data across various departments which requires to replicate or supply the data to other internal databases.
    In my understanding there are two options
    1) Within the SOA application fork the data hitting the web-service to different databases.
    My concern with this approach is what if organizations keep coming with such requests and I keep forking and supplying multiple internal databases with the same data. This feed has to be real-time, too much forking with impact the performance and create unwanted dependencies for this critical link for data supply.2) I could tell other internal projects to get the data from the populated main database.
    My concern here is that firstly the data is pushed into this database flat without any constraints and it is difficult to query to get specific data. This design has been purposely put in place to facilitate real-time performance.Also asking every internal projects to get data from main database will affect its performance.
    Please suggest which approach should I take (advantage/disadvantage. Apart from the above two solutions, is there any other recommended solution to mitigate the risks. This link between our organization and external party is somewhat like a lifeline for BAU, so certainly don't want to create more dependencies and overhead.
    Thanks

    I had tried implementing the JMS publisher/subscriber pattern before, unfortunately I experienced performance was not so good compared to the directly writing to the db adapter. I feel the organization SOA infrastructure is not setup correctly to cope with the number of messages coming through from external third party. Our current setup consists of three WebLogic Servers (Admin, SOA, BAM) all running on only 8GB physical RAM on one machine. Is there Oracle guideline for setting up infrastructure for a SOA application receiving roughly 600000 messages a day. I am using SOA 11.1.1.4. JMS publisher/subscriber pattern just does not cope and I see significant performance lag after few hours of running. The JMS server used was WebLogic JMS
    Thanks
    Edited by: user5108636 on Jun 13, 2011 4:19 PM
    Edited by: user5108636 on Jun 13, 2011 7:03 PM

  • Carrying data between two webdynpro programs.

    Dear Experts,
    Consider the scenario and please give the solution.
    I waant to design a re-imbersment form, in ESS, where a employee submits a claim form, after which a workflow is triggerred in RFC givin mail to the approver. Then the approver logs in with his id in the ESS. He gets the same screen but without some buttons and  with some buttons to approve the request.
    My question is how to trigger this eventing. How to pass data between these two webdynpro programs written for employee and the approver, and howw to trigger the event as whent the employee submits the form only after that the screen is visible to the approver.

    Hi Vineet,
    Here is what I will do for this problem:
    1) There will be only one application for employee and approver. Based on the role, we can hide/show the relevant buttons to both of them.
    2) I am not sure if you are using CAF Layer. If you are using you can use the Local Persistancy feature to store the data temporarily there and only after approval the data gets posted into SAP.
    However, if you are not using the CAF Layer, I suppose you will have to create some temporary tables to store the data once the employee submits the application. This should also generate some unique request ID.
    3) Once the employee submits the application, you need to configure to send the alert to the approver via mail or in SAP UWL. The mail and UWL should contain link to the same application with the some unique request ID. When you read the tables second time with the request ID and the role approver you should show the user approval buttons.
    Thats what I can think of at a very high level.
    Regards,
    Shubham

  • Using events (?) to share data between tab pages

    I don't know whether this is an event question or an Object-Oriented design question or a JTabbedPane question.
    I'm pretty new to Java, so be patient!
    I wish to have a JTabbedPane with a tab to do 'Import' of data, and a tab to do 'Export' of data (the SAME data which was imported). Now, how do I share the data between the 2 tabs?
    It seems the data belongs at the JFrame level, but then how does the data in each tab access it? In other languages I would pass a reference to the data object in the window to each tab.
    Or how do I get (or set) the data when the tab changes? And how do I know when the tab changes?
    I think I need to set trigger some sort of event to the parent window, who I suppose has a listener, and then it can then query the appropriate pane? If so, I'm not sure what sort of event trigger I should be using, where etc.
    I know if I had one tab with an import/export functionality then I could declare the Collection within that panel.
    Help!!!
    Thanks ;)

    I think this is an OO design question.
    You basically have two views (the two panes) of the same data. So I'd suggest the Observer pattern (see the Design Patterns book) where one model holds the data and the model is observed by several views.

  • Basic questions on data modeling

    Hi experts,
    I have some basic questions regarding data modeling within MDM. I understand the available table types and the concept of lookup fields. I know that the MDM data modeling concept is different to the relational concept. But having a strong database background my first step was to design a relational data model which I would like to transfer to a MDM repository. Unfortunately I didn't found good information material on this. So here are some questions maybe you can help me:
    1) Is it the right approach to model n:m relationships with multivalued lookup fields? E.g. main table Users with lookup field from subtable SapAccounts (a user can have accounts in different SAP systems, that means more than one account).
    2) Has a record always be unique in MDM repositories (e.g. should we use Auto ID's in every table or do we have to mark a combination of fields as unique)? Is a composite key of 2 or more fields represented with marking these fields as unique?
    3) The concept of relationships in MDM is only based on relationships between single records (not valid for all records in a table)? Is it necessary to define all relationships similar to the relational data model in MDM? Is there something similar to referential integrity in MDM?
    4) Is it possible to change the main table to a sub table later on if we realize that it has also to be used as a lookup table for another table (when extending the data model) or do we have to create a new repository from scratch?
    Thank you for your answers.
    Regards, bd

    Yes you are correct. It is almost difficult to map relational database to mdm one. But again MDM is not 'just' a database. It holds much more 'master' information as compared to any relational db.
    1) Is it the right approach to model n:m relationships with multivalued lookup fields? E.g. main table Users with lookup field from subtable SapAccounts (a user can have accounts in different SAP systems, that means more than one account).
    Yes Here you need to use MV look up tables or can also try Qualifier tables if it gets more complex
    2) Has a record always be unique in MDM repositories (e.g. should we use Auto ID's in every table or do we have to mark a combination of fields as unique)? Is a composite key of 2 or more fields represented with marking these fields as unique?
    Concept of uniqueness differs here that you also have something called Display Fields (DF). A combination of DF can also be treated as Unique one. For instance while importing records if you select these DF as a combination, you will eliminate any possible of duplicates based on this combination. Auto Id is one of the ways to have a unique id once record is within MDM. While you use UF or DF to eliminate any possible duplicates at import level
    3) The concept of relationships in MDM is only based on relationships between single records (not valid for all records in a table)? Is it necessary to define all relationships similar to the relational data model in MDM? Is there something similar to referential integrity in MDM?
    Hmm... good one. Referencial Integrity. What I assume you are talking is that if you have relationships between tables then removing a record will not be possible as it is a foreign key for some record. Here MDM does not allow that. As Relationships within MDM are physical and not conceptual. For instance material can have components. Now if material does not exist then any relationship to components is not worthwile to maintain. Hence relationshsip is eliminated.  While in relational model relationships are more conceptual. Hence with MDM usage of lookups and main table you do not need to maintain these kind of relationships on your own.
    4) Is it possible to change the main table to a sub table later on if we realize that it has also to be used as a lookup table for another table (when extending the data model) or do we have to create a new repository from scratch?
    No. It is not possible to convert main table. There is only one main table and it cannot be changed.
    I went for the same option but it did not work. What I suggest is to look up your legacy system one by one and see what fields in general can be classified as Master, Reference, Transactional - You will start getting answers immediately.

  • Best approach to synchronize data between two oracle database remotely

    Hi All,
    We have requirement to synchronize data between custom application database and EBS database. Thw two database is on different location connected by 128 kbps connection.
    The synchronization will do the following task :
    - Download customer table from EBS (I have checked there are only 2000 rows of it)
    - Up load billing data to EBS auto invoice interface table
    The question is :
    What approach is the best way to do this synchronization task ? some that come into my mind :
    - create database link and run stored procedure to do the batch update ?
    - for Customer synchronization, is it a good idea to create Materialized view so that any update to EBS customer data will be updated, refreshed nightly
    - or is ther any better approach ?
    Thank you very much,
    xtanto
    Edited by: xtanto on Oct 18, 2008 3:30 PM

    Maybe try Streams?

  • Design Question: Multi-page Enrollment Process?

    I'm thinking of 3 different possible design approaches for a multi-page customer enrollment process and wanted to know if anyone had any recommendations? There are 3-5 pages in the sign-up process, each page containing form fields the user inputs information to. The main design issues are around how to save the data between pages, not committing the data to the database unless the user completes the entire process, and handling cases where the user does not complete the entire process:
    1. Store form field inputs in temporary database table; if user completes process copy data to real database table. Can delete rows from temporary table as part of nightly cleanup process (i.e., rows where customer bails part way through enrollment)
    2. Use process-Scope variables to hold the user input; commit data to database after user completes the process
    3. Store user input in View Objects with transient fields as a way to preserve the data; commit the data to the database after user completes the process
    Any suggestions or examples?
    Thanks
    Using JDev 10.1.3 ADF BC / JSF

    sorry, to revive this "old" thread, but could someone please elaborate on this:
    Implement a state-machine for each workflow. Example: basic-info->payment-info->success constitute one workflow for me. This state-machine would be a stateful Java class (holding the current state/page) implementing a StateMachine interface with a method: canTransitionTo(String pageName). Declare this as a session-scoped managed bean. You can optionally wire this to your other controller backing beans for modifying the current state when user presses "Next" in the individual pages.
    So basically, you make an interface with a single method canTransitionTo(String pageName) [btw, this seems like it returns a boolean ... although wouldn't a method like "getAvailableTransitions(String pageName)" be more appropriate?] Then your "State machine" would have some variable that holds the current state, for example, "page one".
    My question is this. Suppose we have 3 pages (much like the example), page one -> page two -> page three
    In the page three Action, how do we check to make sure they are allowed to come to this page? The State Machine would not have any state in it yet ... (maybe this was what point(s) 2 and/or 3 was saying, but I couldn't understand exactly what he was saying... PhaseListener?)
    Thanks

  • Centralized WLC Design Question

    Dears,
    In my scenario, i am designing CEntralized WLC deployment. I have 30 AP in Buidling X(200 Users) and 20 AP in Buidling Y(150 Users). I am planning to install HA WLC CLuster where Pimary & Secondary WLC will reside in physically different Data Centers A & B. 
    I have a wireless Design Question and i am not able to get clear answers. Please refer to the attached drawing and answer the following queries:
    If Buidling X users want to talk to building Y Users, then how Control & Data Traffic flow will happen between Buidling X & Y. Would all the traffic will go to Primary WLC from Bldg X APs first and then it will be Re Routed back to Buidling Y APs? Can i achieve direct switching between Bldg X&Y APs without going toward WLC?
    If Building X & Y Users want to access the internet, how would be traffic flow? Would the traffic from X&Y AP will go tunnel all the traffic towards WLC and then it will be routed to internet gateway?is it possible for Bldg X&Y AP to directly send traffic towards Internet Gateway without going to controllers?
    I have planned to put WLC at physically different locations in different DC A & B. Is it recommended to have such a design? What would be the Failver traffic volume if Primary WLC goes down and secondary controller takes over?
    My Reason to go for Centralized deployment is that i want to achieve Centralized Authentication with Local Switching. Please give your recommendations and feedback
    Regards,
    Rameez

    If Buidling X users want to talk to building Y Users, then how Control & Data Traffic flow will happen between Buidling X & Y. Would all the traffic will go to Primary WLC from Bldg X APs first and then it will be Re Routed back to Buidling Y APs? Can i achieve direct switching between Bldg X&Y APs without going toward WLC?
              Traffic flows to the WLC that is the primary for the AP's, then its routed over your network.
    If Building X & Y Users want to access the Internet, how would be traffic flow? Would the traffic from X&Y AP will go tunnel all the traffic towards WLC and then it will be routed to Internet gateway?is it possible for Bldg X&Y AP to directly send traffic towards Internet Gateway without going to controllers?
              The WLC isn't a router, so you would have to put the Internet traffic an a subnet and route.
    I have planned to put WLC at physically different locations in different DC A & B. Is it recommended to have such a design? What would be the Failover traffic volume if Primary WLC goes down and secondary controller takes over?
    Like I mentioned... earlier, the two HA WLC has to be on the same layer 2 subnet in order for you to use HA.  The guide mentions an Ethernet cable to connect both the HA ports on the WLC.
    Thanks,
    Scott
    Help out other by using the rating system and marking answered questions as "Answered"

  • Link aggregated between NAS and a switch: the Mac as a very slow access...

    Hello,
    in my Office we're working with Macs and PCs and all the data is on a NAS.
    Here is our configuration:
    NAS <-link1->Switch<-Link2->Macs or PC.
    Macs are connected with AFP protocol (because SMB is very slow).
    We want to use Link Aggregation between the NAS and the switch (with 802.3ad procotol) but when we do that all the Macs have a very slow access to the NAS. But all is OK with the PCs.
    What can we do? Is there a problem with macOS X and link aggregation?
    Thank you for your help.
    Nicolas

    Sorry, not sure what the question is exactly.
    You must have an Xserve, or Ethernet cards capable of Jumbo Frames for one, I assume the Switch & NAS are capable?
    Possible clues...
    http://docs.info.apple.com/article.html?path=ServerAdmin/10.4/en/c3ha3.html
    http://discussions.apple.com/thread.jspa?threadID=1715388&tstart=0
    http://www.macnn.com/articles/04/06/21/link.aggregation.for.macs/
    http://www.smallnetbuilder.com/content/view/30556/53/
    http://www.afp548.com/forum/viewtopic.php?showtopic=8309

  • OSPF Area Addition - Design Question

    Hello,
    I have a design question regarding OSPF. I am looking to add a new ospf area (1). The area will live on two Core routers and two Distribution routers. Can you please look at the attached Pics and tell me which design is better.
    I would like to be able to connect Core-01 to Dist-01 and Core-02 to Dist-02 with a connection between Dist-01 and Dist-02, but this will result in a discontiguous area, correct?
    Thanks,
    Lee

    I would say that the more common design is to have just backbone area links between the core routers. But there is no real issue with having an area 1 link between them...
    If I were you, I would not make the area a totally NSSA. Here are my reasons for that:
    - you will get sub-optimal routing out of the area since you have two ABRs and each distribution router will pick the closest one of them to get out to the backbone even though it may be more optimal to use the other one
    - in an NSSA case, one of the two ABRs will be designated as the NSSA translator, which means that if you are doing summarisation on the ABRs, all traffic destined for these summarised routes will be drawn to the area through that one ABR.
    Paresh

  • ISE Design Question

    I have few design questions regarding ISE v.1.0.4.573
    Do ISE 3395 gigabit ports support Link aggregation?  how can i utilize all 4 ports for uplink ?
    When doing a standalone HA setup of 2x3395, Is there a heartbeat link between the two ISE or they will use the same uplink to the network for heartbeat and synchronizing?
    I am designing ISE with WLC. My WLC (5508) setup is like 5 floors having different Vlans but same SSID. How can i make ISE authenticate in this scenario since WGB AP is not supported in ISE v.1.0. Is there a work around for this type of WiFi setup in ISE?
    Continuing from the above setup, while roaming from one floor to another floor after changing Vlan, the user will re-authenticate or use the same session?
    Thanks for the help.
    Regards,
    Zohaib

    1. The current version does not support Link aggregation..
    2. They will use the same uplink to the network for heartbeat and synchronizing.
    3. My suggestion is to assign your SSID an interface group, containing all interfaces belonging to your VLANs, on your WLC and set AAA override. Then, in ISE, create authorization profiles which include the appropriate VLAN. use RADIUS attribute Called-Station-ID with your AP MAC address as condition.
    4. They will use the same session.

  • Two Application in One EVDRE - check data between two application.

    Dear Sap Expert,
    We want to check data between two applications.
    For example, we have in C_ACCT= 100000000  Amount 5000 in Legal Application, we want to check what amount is in that C_ACCT in ICMatching application.
    Problem is that we can't get data from two application with one EVDRE.
    If we will make it using two EVDRE, problem when we retrieve data, rows doesn't match.
    Our question : is it possible to link to two applilcation using one EVDRE? (Just like dimension? For example for first column it will be Legal, for the next ICMatching.)
    If no, how we can solve our needs?
                                 Legal |ICMatching | Difference
    C_ACCT               5000 | 2000           |  3000
    For example      
    (100000000)

    Thanks for answer.
    Does it mean that for example if i just want to check C_ACCT=100000000 between two application(Legal and ICMatching) i should build TWO EVDRE, and i can't solve this problem by one EVDRE. (Or with two EVGET)
    Our aim that we need to check all BASMEMBERS data between two application, it's huge data, so we want supress all zero data(SUPRESS="Y").
    So if we build first evdre for LEGAL, for example it will have, 500 rows.
    Second evdre for ICmatching, for example, will have 953 rows.
    How we can check data and show difference between them?
    Best solution for us, if in one evdre we can retrieve data from two application, so rows will match and we also can supress data.
    Thanks,
    Kadraliyev Yerlan

  • How to exchange data between the html in the form layout and itsparameters?

    i am trying to rephrase a question i asked a few days back and which yielded no response.
    is there any way to exchange/transfer values or data between the html in the form layout editor and the form parameters?
    for instance, is there any bridge such that the form template design (controlled by some html-based attribute), or the display property (again managed by some string value for the style:display attribute) of some of its divisions etc could be controlled by the values passed to some parameters of a portal form?
    has any body ever tried to do it or thought of doing it? or it's inherrently beyond the portal forms capacity?
    folks, any clues or hints on 'yes, that's how' or 'no, and that's why not!' please? will greatly appreciate.
    Naqvi

    i am trying to rephrase a question i asked a few days back and which yielded no response.
    is there any way to exchange/transfer values or data between the html in the form layout editor and the form parameters?
    for instance, is there any bridge such that the form template design (controlled by some html-based attribute), or the display property (again managed by some string value for the style:display attribute) of some of its divisions etc could be controlled by the values passed to some parameters of a portal form?
    has any body ever tried to do it or thought of doing it? or it's inherrently beyond the portal forms capacity?
    folks, any clues or hints on 'yes, that's how' or 'no, and that's why not!' please? will greatly appreciate.
    Naqvi

Maybe you are looking for