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.

Similar Messages

  • How can share data between jsp pages using beans??

    any one can give me code for 2 jsp pages with bean that share data for them

    <jsp:usebean name="yourBeanName" type="com.whatever.foo" scope="session"/>
    this will look for a bean named yourBeanName in the scope specified by the scope attribute. If none was found, the container will instantiate one with the no arg constructor for your bean and place it into the proper scope.
    if your bean had a method getName(), you could then on your jsp do:
    <%=yourBeanName.getName()%> to print the results of the method to the page. there are other ways to do the actual placing of the output on the page, but this is the most direct.

  • How can I share data between two forms on different lists

    Using a custom content type, I created two lists that I want to share the same data - one is a calendar.  Our employees complete a form from the "Out of Office Request" list that has workflow functionality that sends an email to that person's
    manager.  If the manager approves the request, the item automatically populates the "Out of Office Calendar."  The problem is that the only information from the request list that populates the calendar is the Title field and date/time fields. 
    I need the manager name in order to create a view for each manager.  
    How can I connect the other information in the request list to the calendar list.  It seems to me that if the title and date fields carry over the information, there should be a way to connect the other information.  I'm using Designer.
    I've tried to connect the two lists' webparts with the wizard, but when I get to the page that maps the two lists, there are no column names and the "Next >" button is grayed out.  This seems like the logical place to connect the two lists,
    but it isn't working.

    Hi,
    According to your post, my understanding is that you wanted share data between two forms on different lists.
    To show external  information on the calendar event, there are two methods: Calculated column, workflow. You can refer to:
    A Simple Guide to Show More Information on a Calendar Event
    I recommend to use workflow to achieve what you want. But you need to create a people column to display the manager.
    You can create a workflow associated to the "Out of Office Request" list, add action to Start Approve Process. If the manager approves the request, you can create a item in the calendar, and then update the people column and the title column.
    Then the calendar will display the Title, date/time and the manager.
    To create a view for each manager, you need to modify the Filter. You can use the people column is equal to the manager name or the Title contains the manager name.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Share data between built exe:s.

    Hello.
    How do I share data between two built exe:s ? I now use a global variable between two VI:s and it works exactly as I want. However, when I build the application
    the communication between the two exe:s is lost.
    All help appreciated. Real examples are really appreciated to.
    Regards
    Andreas

    Hi Andreas
    If you have an application, it allocates memory. All global variables are located in this memory. The same happens for the second application.
    So that's why it doesn't work. If you have to vis and start them with LV, they both are running in the memory range of LV.
    One way to solve your problem is some kind of client-server architecture. You could have a third application which acts as a data-server and the other two apps act as data-clients.
    Hope this helps.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How can I share data between WinXP Pro and Mac OS 10.8.3 via wifi

    How can I share data between WinXP Pro and Mac OS 10.8.3 via home wifi. 

    MartyP wrote:
    Or is there a problem with both OS's writing stuff to the
    ~/Home/Library folder that may be incompatible?
    Yes, big time.  Mail, for sure, has a different file/folder structure, and would not be happy.
    Plus, a number of apps (Apple and 3rd-party) are "Sandboxed."  That's a security feature, to prevent malware or bad coding from affecting things it shouldn't.  Some of their files, including the preferences files, aren't even stored in the same places!
    Or to other places I'm not aware of?
    Probably.  If you have two versions of the same app, they may or may not expect the same data setup.
    To have one User folder for both OS's would save a lot of drive space
    Not if you use some or all of woodmeister50's suggestions. 
    But I'm also not sure how I'd use Time machine with such a set up.
    Just as you do now.  By default, Time Machine backs-up everything (except things like system work files, most caches and logs, trash) for all users and all internal drives & partitions.  By default, it excludes external drives.
    You can change those defaults, of course, via TM Preferences > Options.
    See Time Machine - Frequently Asked Question #32 for details and considerations of multiple drives.
    Presently I backup with . . . clones to other HD's
    Good.   Yes, clones are different.  You need multiple "tasks" to back up multiple drives/partitions.  But once set up, that shouldn't be a big deal.

  • Using EPMA to transfer data between HFM and Essbase on 11.1.1.3

    Can we use EPMA to transfer data between HFM application and Essbase cubes on Hyperion version 11.1.1.3?
    As far my understanding we can only link HFM and Essbase through EAL.
    I would be very keen to know from the audience if we can use EPMA to transfer data between HFM and Essbase
    Hyperion version 11.1.1.3
    Windows 2003 64-bit
    Regards
    Yogananda Bharadwaj

    Hi Yogananda,
    Check epma admin.pdf, page 439. Chapter 19 describes how to synchronize and map data between Hyperion applications, interface tables, and external files via EPMA Data Synchronization.
    Regards,
    Thanos

  • How to share data between applications.

    I'm trying to share data between LabVIEW v6.0 and another program (16 bit), both running on Windows95. At first DLL's seemed to be the answer but I would need to call 16 bit DLL's which I understand can be a problem. With my limited knowledge of C++ I've written a program (Borland C++4.2) which can access the data I need and save it to a file, this is then repeatedly read by LabVIEW, crude but it works. When I add code to do the same the other way I get occasional file sharing errors. I can't get either LabVIEW or C++ to trap these errors. As an alternative I thought I could write and read to a reserved portion of memory (less than 1K should be enough) using in port and out port. Is this viable, and if so how do I
    reserve the memory in Windows 95 so that LabVIEW & my C++ program can access it?
    Any suggestions?

    Ian wrote:
    > I'm trying to share data between LabVIEW v6.0 and another program (16
    > bit), both running on Windows95. At first DLL's seemed to be the
    > answer but I would need to call 16 bit DLL's which I understand can be
    > a problem. With my limited knowledge of C++ I've written a program
    > (Borland C++4.2) which can access the data I need and save it to a
    > file, this is then repeatedly read by LabVIEW, crude but it works.
    > When I add code to do the same the other way I get occasional file
    > sharing errors. I can't get either LabVIEW or C++ to trap these
    > errors. As an alternative I thought I could write and read to a
    > reserved portion of memory (less than 1K should be enough) using in
    > port and out port. Is this viable, and if so how do I reserve the
    > memory in Windows 95 so that LabVIEW & my C++ program can access it?
    >
    > Any suggestions?
    May be TCP/IP or UDP interprocess communication will do? It shouldn't be
    a problem via localhost. You can try separate VI server to handle
    communication task from your vi with C++ socket.
    Sergey Krasnishov
    Automated Control Systems
    National Instruments Alliance Member
    Moscow, Russia
    [email protected]
    http://acs.levsha.ru

  • How do I share data between my MBP and iMac?

    I have two Genealogy programs on my iMac that I would like to share data between my MBP and the iMac.  I would like to gather the data on the MBP and then share new data to the iMac which is where I basically do all of the Genealogy work from, since it is much easier with the larger screen and better keyboard. 
    Can someone please explain or direct me to a tutorial or procedures if this is possible?  Thank You!

    Click Apple>System Preferences>Sharing
    Check File Sharing. In File Sharing add the folder you want to share with another computer. Then add users. Then proide access previledges such as Read & Write, Read Only, Write Only or No Access.
    Now in the System Preferences, Click iCloud, sign in to iCloud. It's free and you can access your Macs from anywhere.
    In iCloud, check Back to My Mac.
    Do the same to another computer. You're all set by now.

  • I'm using FF 3.5.18 and I do not want newer versions because : using in the Open in New Tab page opens the near tab and not as a FF 3.5.18 or is it possible to do that open in new tabs would be the end. of the new FF version

    I'm using FF 3.5.18 and I do not want newer versions because : using in the Open in New Tab page opens the near tab and not as a FF 3.5.18 or is it possible to do that open in new tabs would be the end. of the new FF version

    You can change a preference to make tabs open
    # at the end of all open tabs
    # immediately after the current tab.
    See: http://kb.mozillazine.org/About:config
    *Type '''about:config''' in the URL bar and press the Enter key.
    *If you see the warning, accept it (promise to be careful).
    *Filter = browser.tabs.insertRelatedAfterCurrent
    *Look at the "Value" column ('''false'''=open at end, '''true'''=open after current tab); Value = true is the default.
    *Double-click that preference to toggle the value from true to false, or false to true
    *Restart Firefox (File > Restart Firefox)
    See: http://www.mydigitallife.info/2010/02/01/change-firefox-to-open-new-tab-at-far-right-end-of-tabbar-disable-insert-next-to-current-active-tab/

  • Change the data selection tab page in an InfoPackage

    Hi SDN Community,
    Is it possible to have an Infopackage and change the data selection tab page ? Because  I would like to know if  I can change the select-options by a parameter.
    For example: Now you can enter 01.01.1950 as the start date and 31.12.9999 as the end date,
                          I only want that the user enter the start date.
    Thanks a lot,
    best regards.
    Ana

    Yes, I tried an abap routine option and the result is not good because the user can't put the information in the low (start date) parameter.
    Thanks

  • How the hell does a person share session data between JSP page and a Servle

    1. How the hell does one share session data between a servlet and a JSP page without using a bean but rather using a normal string variable.
    2. When using session scope to access a bean the application complains about not finding the bean on the specified scope, however when I use an application scope the save the same bean, the application does find it.
    Please help!!!!!!!
    SERVLET:
    HttpSession session = request.getSession(true);
    ServletContext servletContext = session.getServletContext();
    customerID = result.getString("CustomerID");
    userName = result.getString("UserName");
    session.setAttribute("UserName",userName);
    session.setAttribute("CustomerID",customerID);
    System.out.println("Customer UserName = " + session.getAttribute("UserName"));
    response.sendRedirect("/economics/subscriptions/default.jsp");
    JSP PAGE:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root xmlns:jsp=http://java.sun.com/JSP/Page mlns:c="http://java.sun.com/jsp/jstl/core" xmlns:sql="http://java.sun.com/jsp/jstl/sql" version="2.0">
    <jsp:directive.page isThreadSafe="true" session="true" contentType="text/xml"/><jsp:output omit-xml-declaration="false"/><jsp:scriptlet>response.addHeader("x-xslt-nocache", "true");</jsp:scriptlet><pml>
    <page type="web" search="y">
         <pageName>Commercial Banking</pageName>
         <jsp:directive.include file="/economics/header.inc"/>
         <jsp:directive.include file="/login.inc"/>
         <jsp:directive.include file="/economics/leftMenu.inc"/>
         <!--<jsp:useBean id="UserName" type="java.lang.String" scope="session" />-->
         <content>
         <searchSum>Commercial - Main Content</searchSum>
         Value = <c:out value="${request.session.getAttribute("UserName")}"/>
         </content>
         <jsp:directive.include file="/economics/rightNav.inc"/>
         <jsp:directive.include file="/footer.inc"/>
    </page></pml></jsp:root>

    For a start, just "session" instead of "request.session" would work better. But why did you post this here and not in the JSP forum? Doesn't seem to have anything to do with Java programming.

  • Pass data between Tab Control Pages

    I’d like to initiate a serial VISA session in the first page of a Tab Control to use the VISA Serial Configure.VI outputs (Visa resource name and Error cluster) in other pages or outside the tab control.
    So, how can I pass those references outside the page? I used local variables, but it doesn't seem the best way to do this because I need to create several variables to capture the reference in each page of the tab control...
    I created a sub-VI to initialize the VISA session, but in this case it always starts a new session every time I use the sub-VI….
    Thanks in advance!
    Klein
    =====================================
    Block Diagrams (LabVIEW 8)
    Message Edited by Klein on 04-03-2007 12:56 PM
    Attachments:
    TabControl.vi ‏37 KB
    TabControl - Page1.jpg ‏94 KB
    TabControl - Page2-3.jpg ‏165 KB

    There's no reason at all to wire the tab control to a case statement. Since you have the read and write Booleans and they can't be clicked until the user changes tab pages, no code for the tab is necessary.With the Booleans for write and read, you should just have an event structure for those. You could initialize the serial port outside the main while loop and just pass the resource name in. Of course, if you wanted a tab for the init funciton, you could do that to but put a Boolean on that page to execute it. The only time you need to wire the tab control to a case statement is if you want to run some code immediately when the page is clicked.
    Attachments:
    Tab_Example.vi ‏45 KB

  • Restore Data between multiple pages

    Hi All,
    I have 3 jsp pages for the registration part.The user can navigate between these pages and finally submit it from the third page.
    Now lets say the user enters data on the first page and clicks on Next to go to second page. He enters some more data on second page and now wants to edit the data entered on the first page.
    How do I store the values entered by the user in the first page?
    In normal struts all the data entered will be in form bean defined.So the data is available.
    Please let me know how to handle it using ADF as there is one common Dataform ?
    waiting eagerly for the repsone
    Thanks

    If you get this one figured out, I'd really like to know.
    We dropped the bindings on each page (like an Input form), but removed the unnecessary bindings. We created an event_Next button and event_Previous buttons as well as a [Save] and [Cancel] button.
    The forwards between the pages would call a method in the DataForwardACtion for the page, i.e. onNext. The only action we'd do in there was a Commit. (we didn't want to lose anything). However, all of our validation was done inside Struts Validator with custom extensions. This is probably not the route you are supposed to go with ADF as validation should be occurring at the entity, but it was at least "workable" for now. As we learn more about things, we'll probably revisit this.

  • Global variables to share data between separate programs.

    Hi guys and gals,
    On the advice of a lv consultant, we've used an array of global
    variables to share data (about 100 variables) between an acquisition/control
    program and a consumer program (datalogging) running on the same PC. This
    worked fine in the development environment. However it no longer works when
    the two programs are compiled. Is there a trick to get this to work or do
    we have to use datasockets or DDE to move the data.
    In case you're wondering the idea of two separate programs is to
    separate the critical control and data acquisition functions from the less
    critical but more likely to error datalogging functions.
    Regards,
    Alf Katz,
    [email protected]

    There are several solutions:
    1.) Use VI Server available in LabVIEW 5.1 and Up to provide a communication
    path between the two executables.
    2.) Use a data file to transfer the data between the two executables.
    3.) Use a TCP/IP connection there are several examples included with LabVIEW
    showing the mechanics of this.
    The simplest method is Number 1. Using the VI server, you open the
    connection and then retrieve the data form the Global VI based on the
    Parameter Name. It is very fast and requires very little processor
    overhead. Make a driver to Open the connection then a Read to get the data.
    Do not open and close the connection everytime, there is a lot of overhead
    in the Open connection call.
    Make sure you configure the VI Server within the development environmen
    t.
    Also you must include a few statements in the Executables INI file to
    correctly enable the VI server capabilities.
    Regards,
    Jeff Meyer
    Consultant
    Focused Energy
    Suffield, CT USA
    "Alf Katz" wrote in message
    news:[email protected]..
    > Hi guys and gals,
    > On the advice of a lv consultant, we've used an array of global
    > variables to share data (about 100 variables) between an
    acquisition/control
    > program and a consumer program (datalogging) running on the same PC. This
    > worked fine in the development environment. However it no longer works
    when
    > the two programs are compiled. Is there a trick to get this to work or do
    > we have to use datasockets or DDE to move the data.
    >
    > In case you're wondering the idea of two separate programs is to
    > separate the critical control and data acquisition functions from the less
    > critical but more likely to error datalogging functions.
    >
    >
    > --
    > Regards,
    > Alf Katz,
    > [email protected]
    org
    >
    >
    >

  • Using XML to exchange data between different databases?

    Hi,
    Does anyone know of any case-studies or tutorial's where XML has been used to transfer data between different databases... i.e. oracle to sql server?
    I basically looking into the differences between two schema's and what sort of tranformations need to take place.
    Thanks in advance guys!

    Hi,
    Does anyone know of any case-studies or tutorial's where XML has been used to transfer data between different databases... i.e. oracle to sql server?
    I basically looking into the differences between two schema's and what sort of tranformations need to take place.
    Thanks in advance guys!

Maybe you are looking for

  • Error trying to install CS4 design premium on windows vista home premium

    I'm having trouble installing CS4 design premium, as soon as it does the checking system it comes up with an error that says I need windows XP sevice pack 2 and some other windows.  I have Windows vista home premium and all the other requirements, so

  • Changing audio driver

    When I hooked up a USB mic and clicked on the name of the mic in System Pref, it said: "Do you really want to change audio driver?" What does this mean? Do I have to change audi drivers for both input and output? Do have to change settings when I am

  • Quicktime X issues

    I recently upgraded to Snow Leopard, and since then iTunes and all of my iWork programs are crashing at launch. I finally figured out last night that my Quicktime is faulty, as well. I'm sure this is why iTunes won't open, but not sure if that also h

  • Oracle 9i install on SuSE 8.0 Pro failing

    I get the following error when I try to run the "runInstaller" script on SuSE 8.0. I'm following the Oracle 9i SuSE installation instructions, but can't find any reference to this error. Does anyone have any advice? $ ./Disk1/runInstaller Inconsisten

  • ASN Reference document number is invalid error with SA

    Hi~ We have ASN creation error with SA(Scheduling Agreement). Portal Menu : Delivery-Receipts and Requirements-Due List for purchasing document(Supplier) 1. Select SA(Scheduling Agreement) line 2. Click 'Create ASN ' 3. After enter ship from location