How do i make a button open a new window...

Hi,
I'm making some very basic login software and i want the program to open up a new window when the "Login" button is pressed and then display a message saying whether the login was successful or not.
Any help would be appreciated but i would love some code to help me see how to do it and help me on my way.
Cheers.

what do you exactly need, the "how to create and display a frame"? I bet your program already has a frame, so I suspect you know how to do that. Well, just do it again.
Note: if its just a plain message you wish to display to the user, the easiest way will be by using javax.swing.JOptionPane, look for the showXxxx methods.
If the question was more "how do I know when my button get pressed", take a look at that other question: http://forum.java.sun.com/thread.jsp?forum=57&thread=156406

Similar Messages

  • How do you make a button open a new window?

    I am trying to create an action that opens a new window but cannot figure out how to do it. Does anybody have any help with where to start?

    Select a View-based Application give the name as Button & add a new file give the name SecondViewController,
    Write the following code in Button.m
    Import your SecondViewController , By writing statement
    #import "SecondViewController.h"
    - (void)viewDidLoad {
        [super viewDidLoad];
              UIButton *btnObj = [UIButton buttonWithType:UIButtonTypeRoundedRect];
              btnObj.frame = CGRectMake(40, 40, 70, 50);
              [btnObj setTitle:@"CLICK" forState:UIControlStateNormal];
              [btnObj addTarget:self action:@selector(nextView) forControlEvents:UIControlEventTouchUpInside];
              [self.view addSubview:btnObj];
              //[btnObj release];
    -(void)nextView{
              SecondViewController *secObj = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
              [self presentModalViewController:secObj animated:YES];

  • How do I get firefox to open a new window when i click on a link in a webpage ?

    When I click on a link in a webpage in Firefox, generally it opens the new page in the window i am in (though some times it does not). How do I get it to open a new window (or tab) each time I click a link.
    For example, on www.bbc.co.uk if I click on a link, the new page opens in the same window, if I then click another link in the new window, again, it opens in the same window. To get back to the original window, I have to use the back button twice. Surely there is a setting so that all 3 windows can be open on separate tabs or separate windows.
    I have been to the tabs window in options, but doesn't seem to make a difference.

    Open link/bookmark in new tab in same window:
    *Middle-click (press the mouse scroll wheel) the link
    *Ctrl+left click the link
    *right-click the link, choose "Open Link in New Tab"
    Open link/bookmark in new window:
    * Shift+Enter on the link
    * Shift+left click on the link
    See: http://www.7is7.com/software/firefox/shortcuts.html

  • Home button opens a new window instead of just returning active tab to home

    Running firefox 9.0.1 on Snow Leopard. After browsing for a short time clicking on the home button opens a new window instead of just returning theactive tab to home

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode

  • Exit button - Opens a new Window

    Portal experts,
    We are facing some problem with exit button in the standard iViews like Bank, personal data.
    When we click on the exit button, it is opening a new window rather than coming out of the iView. I searched for sap notes, didnt find anything.
    can anyone faced this problem?
    Please help us.
    Cheers
    Jay

    Hello Jay,
    Yes you make the settings using Work Protect Mode in the Portal. If you don't want to open a new window you need to configure workprotect mode.
    Simply follow this Note 734861 - WorkProtect Mode - Global Settings
    Let me know in case you face any issues.
    Vijay

  • How do I stop Firefox from opening a new window when I go to a search item?

    When I do a search, and click on a topic, Firefox opens a new window on the tool bar at the bottom of my screen. How can I stop this from happening?

    I'm guessing you use Google for search. There is a setting in Google search to open each result in a new window. (When you use tabbed browsing, that means each result opens in a new tab.) You can check on whether you have that setting turned on as follows:
    On a Google results page, click the button on the right side with the "gear" icon, then click Search Settings from the drop-down list. At the bottom of the page is the setting to open results in a new window.
    Is that the culprit?

  • How do I change firefox to open a new window when I start it several times instead of opening a new tab when I want to go to a different location?

    I want to go to several different websites at the same time. I want to compare the information on each site. I do not want to open a tab, I want a whole new window. How do I change firefox so it will open a new window instead of opening a new tab and then requesting the site I want to go to?

    In Windows XP I am able to right click a link and get an option to open it as a new Firefox window
    *'''tear off tabs'''
    You will probably note tabs can be dragged along the tab toolbar, they also tear off. You can click a tab and drag it off the browser onto the Windows Desktop where it will open as a new window, or drag it on to another open browser window.
    An alternative is to click the tab and drag it down, again it will then open in a new Window.

  • Logoff button opens a new Window

    Hi gurus,
    we have newly installed EP 6.0 SP20. When we try to logoff the portals with the log off button, a new window is opened and the logoff takes a lot of time to actually logoff. The new window is open even after the delayed logoff. Has any one faced this issue and is it a known issue and does it have a fix or suggest take it up with SAP as i have not found anyrelated notes
    Please Advise
    regards
    raj

    Hi,
    logoff portal issue are also ""common"" in EP7.
    With the EP7 SP6 or 7, sorry I can not exactly remember, we were experiencing log off problem using IE6.
    Mozilla were working.
    With SP 11, log off option works on both Mozilla and IE 6, opening a new window and log off quite quickly.
    Here's my little experience.
    Fabien.

  • How do I disable finder from opening a new window upon mount?

    When an external drive is mounted (such as an iPod in disk mode) Finder opens a new window showing the root of the new drive.
    I realise why this happens, but is there any way of disabling this feature?.
    Cheers,
    Ebsy

    It seems that there is a special flag that can be set or cleared on the volume to control that behavior. There is an Apple developer article about it, with source code, that might help.
    http://developer.apple.com/qa/qa2005/qa1449.html
    I have to believe that someone has packaged up that code into a utility that can be found.

  • Xcode 4: Target and Commands. How do i make a button open "Window"?

    So to keep this short i'm making a very simple program and i need some help from Mac Developers.
    I'm making it in objective-C and i want to make 1-button target another program for example when u click on the button it "focuses" on iPhoto like when u click on it yourselves. Now i also want it to instantly, do some key-commands. I want it to target program > enter > write something > enter.
    I'm need this very very much. Please help me, it can't be that hard, if it is possible.
    Now in the bottom of the program it says my name, but there's also a little button to the right. Now i just started with Mac Developing, have been working for 2months with iOS in Xcode 4. So i know how you switch "views" for iOS, but how do i make this little button to the right, open a "window" (It's gray, hehe) and the button should be highlighted and when u click it again it goes back to normal and it closes. Now pretty much all i know is how to make the pop-up window remove the red dot and x in the corner, so u can't manually close it. I've tried googling highlighting button when the window is open, but didn't find anything.
    Please someone help me, this program is a free program and not for the AppStore.
    I'm making it for a group of Mac users.
    <Edited by Host>

    if you have a navigation controller do this: SecondViewCOntroller is the name to your .m (don't forget the import). SecondView is the name of your second View. You have to connect the function and the button in the xib file.
    -(IBAction)press1
    SecondViewController *nOVC  = [[SecondViewController alloc] initWithNibName:@"SecondView" bundle: nil];
    [self.navigationController pushViewController: nOVC animeted:YES];
    Look at an example in apple developper...
    Perhaps it's not that because you learn during two months iOS and it's a beginner thing.

  • How do I make fire fox open a new tab when I type in the search bar and press enter?

    Hi,
    I know I have found this solution before, but can't find it again. Please help?
    In FF 27.0.1, when I put the cursor in the search bar, type words and hit enter, it starts the search in the current tab. How do I make FF always start the search in a new tab when I hit enter from the search bar?
    Thanks!
    G

    Hello,
    Go to '''about:config''' search for '''browser.search.openintab''' change its value to '''true'''
    *[http://kb.mozillazine.org/About:config about:config]

  • How can i make QuickTime movie open a browser window?

    like title says, how can i accomplish this when i create/edit the QT movie?
    thanks!

    You set the "href" link or use the target=your URL in your page code.
    Quicktime 7 can also be used to set some movie proprieties to open the file in a new Player window.
    http://homepage.mac.com/kkirkster/03war/
    One of my files that uses the QuickTime Player app.
    If you wish to include a "link" inside your file to automatically open a new Web page when a certain frame of your movie is played you need to include a HREFTrack.
    This feature is currently "broken" in the Windows version of QT 7.
    Older versions still incorporate the href track properly/

  • How to properly close task flow opened in new window?

    Have a question on the best practice to properly close a task flow when it has been opened in a new window.
    We are opening multiple bounded task flows concurrently in new windows but want to make sure the task flows are properly cleaned up. Scenario is that of an email in-box where the user can open multiple messages concurrently. Want to have the "Close" button that closes the window and properly exits the bounded task flow.
    thanks,
    Rodger...

    Hi Frank
    I'm hoping the after listener will fire (haven't tested it yet)
    What I would like to do is to create a method in the application module that does (I'm typing this from memory so there might be some typos):
    procedure void cleanTransaction() {
        if this.getDBTransaction().isDirty() {
          this.getDBTransaction().rollback()
    }then expose the method in the application module client implementation.
    Then in a pageFlowScope bean method find the application module and call the cleanTransaction() method.
    The bean method could then be hooked up to the after listenr.
    Would this work, and how do I find the application module ?
    Also I not sure if it is the application module hanlding the transaction or the data frame.
    Regards
    Paul

  • Make your links open in new windows

    And before I forget... This was another thing I remembered during my internet outage...
    If anyone knows where the JavaScript is stored or generated for the pages, technically you could insert a small script in there that would allow you to then specify URLs for your hyperlinks that generate new windows.
    This is one way to write the script:
    <script type="text/javascript">
    <!--
    function open_window(url) {
    window.open(url,'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes ,scrollbars=yes,resizable=yes,width=800,height=600');
    // End -->
    </script>
    As long as that script is either in the JavaScript file for your page(s), then you can use the following as a way to specify a URL for a hyperlink that pops-up in its own window:
    javascript:open_window('http://www.website.com/');
    Hopefully someone else has found where the JS files are generated or stored because if we can alter THAT information, then we have a far greater arena of functionality that we could open.

    iWeb generate a JS file for an associated HTML file and put it in the page_files folder (e.g Welcome.html has Welcome.js in Welcome_files folder).
    The JS files can be pretty ugly as they are, so editing or adding something else to them is a last resort (as I did in the Photos.js files for slideshow).
    The alternative is add another JS file, but that requires editing the HTML file (adding the script tag inside head tag).
    In the end we almost have to edit the HTML no matter what.
    <!--<br>function open_window(url) ....
    BTW, that is pretty much how slideshow pop open a window. But there is no way to insert javascript functions with iWeb's Inspector.

  • Make iweb hyperlinks open in new window?

    i have tried massreplaceit, using rowan cottage's how-to...this didn't work...and i REALLY want my hyperlinks to open in a new window-does any have any suggestions on how they made this work?

    I could be mistaken because my HTMl is at the newbie stage but I think the target="_blank" needs to look like the following except that I left off the opening and closing anchor tags that must be included:
    a href="http://www.apple.com" target="_blank">apple
    apple
    It is placed after the website address ...apple.com" target="_blank"... not before.

Maybe you are looking for