MVC - More then one view managed by the same contrler.

Ok, I have been reading and searching examples on the MVC .. but all the examples show just what to do when you have just one view of the model. What I f I have the more the n one view to handle the same model.
As we know the views would need to be registerd inside the controler? How can I do this If I have more then one view?
does anyone have any ideas!?
Would it still be correct if when an action occures on my view instead of the controler capturing that event an handiling, I make my view call the controler to handle it?

So in your opinion is it ok if I call my controler from the action event of my button?
I just did a small example below:
import java.awt.event.ActionEvent;
import javax.swing.*;
import java.awt.event.ActionListener;
public class Starter extends JFrame{
     private Model myModel = new Model();
     private Controler myControler = new Controler(myModel);
     public Starter(){
          JButton myButton = new JButton("Test");
          myButton.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent e){
                    myControler.makeAction("Hello");
          this.getContentPane().add(myButton);
          this.pack();
          this.show();
     public static void main(String[] args){
          new Starter();
}As you can see I am calling the controler to manage the new data from the action event of 'myButton' !
Is the above code ok with the spirit of the MVC?

Similar Messages

  • How to call more then one Function modules at the same time

    HI ,
    How to call more then one FM at the same time .
    Modertor Message: Interview-type Questions are not allowed.
    Edited by: kishan P on Jan 2, 2012 2:22 PM

    They are a few different models of the MacBook Pro ranging from 15.4" i7's to 17" i7's. I would use the same models together though when imaging them just like I do with PC's. For example I would Ghost 5 Lenovo T420 Thinkpads at the same time which all share the same exact specs and config. Looking to do the same with the MBP. I have .dmg image of OSX 10.8.1 on a firewire drive which I'm using. I image all my MBP's with this drive, the only downside is I have to do each MBP one at a time.
    Thanks

  • Can I connect more then one cDAQ-9188 in the same network?

    Hi, I have one question for you.
    Can I connect more then one cDAQ-9188 to moxa EDS-G205-T for querying simultaneously in the same PC?
    thanks in advance for any response.

    You will need a network switch and make sure they are different IP Addresses, but same subnet.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Can you use more then one micro photo on the same comput

    i have had my micro photo for a year it works great i just bought another one but my computer wont recognize it. what gives?they are the same player zen micro ohoto 8 gigs

    It should work fine. Both my Microphoto's work connected on XP Pro at the same time, I just have to keep track of which one has what kind of music. Have you tried scanning for plug and play devices, what kind of operating sys are you running? And what software are you trying to sync with.
    Message Edited by VRevolution on 05-23-200706:45 AM

  • Manage more than one news module in the same website

    Hi, I am wondering if it is possible to manage more than one News module in the same website and have them all display different content.
    Like a news module in the News section displaying announcements and a press section module displaying press related news f. e.

    Hello
    Possible: yes
    Recommended: no
    This can certainly be done and Discoverer will not prevent you from having reports that use different business areas as you describe.
    However, for management and security purposes it does not make for ease of use. As you know a user has the ability to share a workbook with another user. If they do this then ALL reports within that workbook are shared. If the receiving user does not have access to one or more of the business areas then some reports will run and some will not. This can be very confusing to an end user and a possible nightmare to administer.
    My recommendation would be to have a workbook per business area and not mix.
    If there is more than one business area per functional area, for example sales and returns, then so long as the users have access to both business areas then you could use a common workbook.
    Personally I would not even do this, so my strongest advice would be to have all reports in a workbook written against the same business area.
    Hope this helps
    Michael

  • Hi gurus in scripts i want to display more then one main window on the page

    hi gurus in scripts i want to display more then one main window on the page how it is to follow any body explain to me plz.

    Hi all,
        I am printing check printing from F110 with Z-form and it has been assigne to FBZP also..
        My client need to print the check information twise that means main window data two times.
        like this: 
           First main window.  :      invice#       amt            amt
                                               9002          4000          4000
                                               9005          5000          4000
    Al so they want like to print same in down part of the main window.
           First main window.  :      invice#       amt            amt
                                               9002          4000          4000
                                               9005          5000          4000
    For this i  have created instance main window of main window like MAIN    01,  but it is not displaying the data in instnce window data
    in the instance main window. 
    Question: Could you please let me know abt the same or good solution. How to cal main window instance , i tried with  
    /:   NEW-WINDOW      in instance main window part but it also appering in main windoe also.
    could you please let me know how to call instance main window or any other solution to get teh data like my example above.
    thx

  • Using more than one Business area in the same report

    Hi,
    Is it possible / recommended to use more than one business area in the same report.
    For example, I have a sales (business area sales) report on one tab and a rebates(rebates business area) report on a second tab.
    Thanks

    Hello
    Possible: yes
    Recommended: no
    This can certainly be done and Discoverer will not prevent you from having reports that use different business areas as you describe.
    However, for management and security purposes it does not make for ease of use. As you know a user has the ability to share a workbook with another user. If they do this then ALL reports within that workbook are shared. If the receiving user does not have access to one or more of the business areas then some reports will run and some will not. This can be very confusing to an end user and a possible nightmare to administer.
    My recommendation would be to have a workbook per business area and not mix.
    If there is more than one business area per functional area, for example sales and returns, then so long as the users have access to both business areas then you could use a common workbook.
    Personally I would not even do this, so my strongest advice would be to have all reports in a workbook written against the same business area.
    Hope this helps
    Michael

  • Can you have more than one apple id under the same account

    can you have more than one apple id under the same account

    Stop using the same Apple ID for iMessage on these devices.  Go to Settings>Messages>Send & Receive (Receive At in iOS 5), tap the ID shown, sign out, then sign back in using a unique ID for each device.  (Or, just sign out and stop using your Apple ID for iMessage.)

  • Using more than one front panel at the same time

    I have a main program where I can call sub vi’s and then the sub vi’s front panel opens.
    I want to use/see/operate more than one front panel at the same time. How I can do it?
    For example when I close the main program it won’t close before I close all the sub vi’s front panels.
    I use event case to call these sub vi’s. Can I close all vi's using one button?

    I wouldn't use subVIs for display, at least not if you plan to have them open all the time. Instead, I would suggest that you have one loop with a FP VI which will talk to the FP all the time and will pass to the data to the other loops through a variable or a functional global.
    Then, you can use a tab control to organize your display. If there is no specific reason for not having the graphs in the same VI, you can use a tab control to organize it. If you can't, you can also use subpanels to display the VIs and put several subpanels in your VI.
    If you still want to display the VIs seperately, you can control their positions and sizes through their proerty nodes, but I don't think there's any reason for this.
    To learn more, I suggest you read the LabVIEW style guide. I think it has some tips about application design.
    Try to take over the world!

  • My sister has a mac and i want to update my phone onto the computer but i dont want her to see all my stuff can you somehow have more than one itunes account on the same computer so my stuff with save?

    my sister has a mac and i want to update my phone onto the computer but i dont want her to see all my stuff can you somehow have more than one itunes account on the same macbook so my stuff with save?

    How to use multiple iPhone, iPad, or iPod devices with one computer. The only way is for you to have a separate user account to log into on that computer.

  • Can i have more than one ipod touch on the same account, or must they both be set up with different id's.

      Can I have more than one ipod touch on the same account, or must they each have their own ID.

    If you use the same account see the following to separate Messages and FaceTime between the two iPod see:
    MacMost Now 653: Setting Up Multiple iOS Devices For Messages and FaceTime

  • Can there be more than one JVM Running on the same machine

    Can there be more than one JVM Running on the same machine.

    Even JVM's of different versions (or vendors) can run on the same box at the same time.

  • Hi, can anyone tell me if I can have more than one iTunes account on the same PC. I've just bought my wife an iPad2 and want to create a separate account for her. Can I do that on the same PC as mine?

    Hi, can anyone tell me if I can have more than one iTunes account on the same PC. I've just bought my wife an iPad2 and want to create a separate account for her. Can I do that on the same PC as mine? Thanks.

    I would advise that you not set up a second Apple ID. It's really not necessary - having two Apple IDs won't affect how iTunes works with your iPads - and will just complicate matters. Each iPad will be treated independently and can be set to sync only the items you want on that particular iPad. If you really want to keep the two iPads separate, set up different iTunes libraries and have only those items you want on the related iPad in that library, rather than a different Apple ID. If you plan not to use a computer and just download directly to the iPads, you can again choose what apps and content each iPad gets.
    But answering your specific question, you can have content from up to five iTunes Store accounts on any one computer or iPad. To create a new iTunes Store account, you'll need a different email address, and from there you just create the account the same way you did the first one.
    Regards.

  • I have a game in the game center(clash of clans) and i have more than one apple mobile on the same account and i dont know how to delete the game(clash of clans) from the game center

    i have a game in the game center(clash of clans) and i have more than one apple mobile on the same account and i dont know how to delete the  game(clash of clans) from the game center.

    Hello ayhamnaser,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    Using Game Center
    http://support.apple.com/kb/ht4314
    If in Game Center > Me > Games > my iOS Games > swipe to the left on the game > Remove.
    Have a nice day,
    Mario

  • How Do I Share My Database Between More Than One User Account on the Same Mac?

    How Do I Share My Database Between More Than One User Account on the Same Mac?

    How to use multiple iPhone, iPad, or iPod devices with one computer. The only way is for you to have a separate user account to log into on that computer.

Maybe you are looking for

  • FCP cannot open because of problem!

    Hi Trying to reinstall final cut suite 2, but getting an error during start up (fcp cannot open due to problem) then a big long log/error list which i have no idea what to do with. Things i've tried: Updating fcp Uninstalling using FCS I'm using snow

  • Paste in JEditorPane

    When doing a cut,copy, paste operation in my Editor Pane The text is being pasted on a new line and not in the selected location. I have set the EditorKit of the Editor pane as follows setEditorKit(new HTMLEditorKit()); If i Comment this line of code

  • Indesign files won't open over a network

    I have just copied my entire work folder from a 17" iMac Core Duo to a 20" iMac Core Duo. When I attempt to open any InDesign files over the network from one machine to the other I get the following message. "Cannot open the document "xxxxxxx". You m

  • LAST ITUNES UPDATE SEEMS TO AFFECT EMAIL

    Prior to this latest issue, can anyone tell me why the Authentication for email changes of its own free will? I choose password, then go to retrieve emails, and it doesn't, so I check the Authentication menu and sure enough, it's jumped off password.

  • Annoying Password pop-up

    OK, I upgraded to OS 4.0 now at 4.02. Ever since the upgrade to OS 4.0 I get a very annoying window that pops up frequently asking for my password. I have not set up any password to protect my phone so I hit cancel and the window goes away. Then, I s