Calling default browser on button click in swings

Hi all,
I have built a window with tab page in it having a button on tabpage in java SWING. Now i want that when ever i click on button it calls my default browser i.e. IE6 with a predefined URL. The browser should open with in the tabpage area not beyond that. Please help........ Many people have helped till now because i am very new to this.......
Again looking for help from experts................

I feel like I answer this almost everyday
search the web for JDIC and webbrowser

Similar Messages

  • Professional way to call that frame on button click?

    Hi
    Nice to get new look and feel for forum :)
    Wel my question is I have a frame which has many buttons textfields labels and other components too.
    On clicking one of the button I am opening a frame which is like calculator(display is same as calculator)
    I am using frame for that calculator.
    My question is that what will be the most professional way to call that frame on button click?
    All you java professionals your kind attention will be appreciated
    Regards

    Good question, I've often wondered this myself!
    Personally, I don't like to use anonymous inner classes for handling events. I generally handle events two ways:
    1. Make the main class implement lots of interfaces and use action commands. eg
    public class MyFrame extends JFrame implements ActionListener {
        public static final String CALC_BUTTON = "cb";
        public MyFrame() {
            super();
            JButton cButton = new JButton("Calculator");
            cButton.addActionListener(this);
            cButton.setActionCommand(CALC_BUTTON);
        public void actionPerformed(ActionEvent ae) {
             if (ae.getActionCommand().equals(CALC_BUTTON) {
                 //do something
    2. Subclass AbstractAction.
    public class MyAction extends AbstractAction {
        //create a constructor specific to the goal
        public MyAction(/*Some arguments*/) {
            //set  variables
        public void actionPerformed(ActionEvent ae) {
             //handle the action
    //and in the main class
    JButton cButton = new JButton("Calculator");
    cButton.setAction(new MyAction());I tend to use the first method more often, but if there's some specific kind of action, then I use the second method.
    I'm interested to know what other people do though. :)
    -Muel

  • How to open default browser of the system using swing

    Iam doing a project in swing iam havina a problem actually if i click click a button on the top of the frame it has to open an asppage or html page in default browser. Please if any body can help me.if anybody having the code or solution please send me.

    I think, but never tried, thatexecuting a html file will automatically ask the OS to open the defaulkt browser. This is like executing a *.doc file will open Word
    o execute a file, you need to use the Process class. Usually, we do something like this
    Process p = Runtime.getRuntime().exec( your command)

  • Despite my selecting Firefox as default browser, any link clicked goes to open IE browser, but that too does not open and sends an error message. Please advise.

    I installed a HP printer on my desktop. To do this I had to temporarily discontinue some services (start/run/services.msc). The printer was installed successfully, but IE got currupted, it seems. Any link clicked went to IE instead of my default browser Firefox, but IE too would not function.
    Please advise what may have happened and how do I correct it?

    {Ctrl + P} and select your printer in the Printer - Name box near the top of that window.
    http://kb.mozillazine.org/Problems_printing_web_pages

  • Show image on the form Java WS gets image. Call this WS on button click

    Hi,
    Is there a way to show an image on the form. On the form I have along with the data I have a button that when clicked get and show the image itself on the form. I have a Java WebService that gets the image from the remote location. How can I make the button click event to call this Web Service and show the image on the form itself. Any help is appreciated.
    Thanks

    WHiteSox, are you on client/server or web version.
    which version of forms are you using.
    something i can think of is.
    during the click to call the webservice, copy the image to the local system.
    next step is, using READ_IMAGE_FILE built in which reads the image from the local file system and displayed on the forms image item.

  • Though I have Firefox set as my default browser, when I click on the Firefox icon, Bing comes up as my browser. Why is this?

    If I go into my Bookmarks after Bing comes up as my browser and then click on Firefox, it comes back as my browser, but I don't like having to go through this extra step.

    Some free software includes an Ask toolbar.
    Try this:
    (1) Disable any Ask add-on (and all other nonessential or unrecognized add-ons) on these two tabs:
    orange Firefox button (or Tools menu) > Add-ons > Plugins category<br>
    orange Firefox button (or Tools menu) > Add-ons > Extensions category
    If you get a link above a disabled extension to restart Firefox, you can click that as the last step after completing your work on the tab.
    (2) Run the Search Reset extension to switch your search providers back to Google:
    https://addons.mozilla.org/en-US/firefox/addon/searchreset/
    (3) If your home page was changed, see this article: [[How to set the home page]].
    (4) Check for a user.js file that might override your settings the next time you start Firefox. See this article for the steps: [[How to fix preferences that won't save]].
    Does that solve it? Any other vestiges to root out?

  • Having Trouble Closing a JFrame With a Button Click in Swing

    I am brand new to Java so this is probably something really stupid.
    On my main form I have a table displaying records from a database. When you double click a record, it pops up a second form showing the details of that record. You can then edit the data in this second form and click a "save" button which saves the data to the database. I want this button to also close that second form, however in the button click event, the second form variable is null.
    Here is some code showing the basic concept:
    public class SampleForm {
        private JButton  saveJobButton;
        private JFrame frame;
        private JFrame editDetailFrame;
        public static void main(String[] args) {
            SampleForm sample = new SampleForm();
            sample.createMainFrame();
        public void createMainFrame() {
            frame = new JFrame();
            JComponent panel = buildPanel(); 
            frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            frame.getContentPane().add(panel); 
            frame.pack();
            frame.setVisible(true);
        public void createEditFrame() {
            editDetailFrame = new JFrame();
            editDetailFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            JComponent editPanel = new SampleForm().buildDetailPanel();
            editDetailFrame.getContentPane().add(editPanel);
            editDetailFrame.pack();
            editDetailFrame.setVisible(true);
            editDetailFrame.validate();
    // save button
        private JButton getSaveJobButton() {
            if (saveJobButton == null) {
                saveJobButton = new JButton();
                saveJobButton.setText("Save Job");
                saveJobButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent e) {
                       .. saves data to database.
                        // here is where I thought the dispose() should go but the editDetailFrame is null at this point.
                        editDetailFrame.dispose();
            return saveJobButton;
        }Any assistance would be much appreciated.

    That handles the NullPointer, but still doesn't close my second Frame. The editDetailFrame should not be null at this point as I am clicking a button on the editDetailFram itself so I think the problem is that I just don't have a reference to the actual object at that point and my variable is just an empty one.

  • Minimisation and controlling button clicks in swings

    Hello All,
    I had some problem in swings.
    Here I am giving my problem in detail.
    1st ......
    On one window named as "Main Screen" contains two buttons.
    Say Button1 and Button2.
    By clicking on Button1 another window will be opened named as "Sub Screen1".
    By clicking on Button2 another window will be opened named as "Sub Screen2".
    I need clarifaction on minimisation.
    If I minimise my main window "Main Screen" all windows which are opened have to be minimised.
    What I mean is if Main window is minimised all subwindows are also to be minimised.
    2nd ........
    When Button1 window "Sub Screen1" is opened by clicking again on Button1 another window is opening.
    How to control the next click until the first have to close.
    If any one will have any idea please give reply as soon as possible.
    ThankYou All,
    Rajiv.V

    Hi Rajiv,
    I assume you are using JFrames in your app.
    You could use the Windowiconified method for your MainScreen and call SubScreen1.setState(Frame.ICONIFIED) and SubScreen2.setState(Frame.ICONIFIED). When you have pressed Button1 the instance of SubScreen1 is not null so you can do sth like this:Button1_actionPerformed(ActionEvent e()){
      if (SubScreen1 == null)
         SubScreen1 = new Frame(..);// or new SubScreen()
      else
         SubScreen1.setvisible(true);
    }Phil

  • How to close the browser on button click?

    Hi,
    On a HTML page, I have a button labeled as "Close". When user click the button, I want to close the browser. I am using Apex 4 with 10g.
    I created the following process which I call on pressing the close button:
    BEGIN
    htp.p('<body>');
    htp.p('<script type="text/javascript">');
    --htp.p('window.opener.doSubmit();');
    htp.p('window.close();');
    htp.p('</script>');
    htp.p('</body>');
    END;But it shows the below in the browser instead of closing it.
    Location: f?p=17638:9:3591448756041585::NO
    Any wayout?
    Thx

    For popup windows I use button code / javascript such as this.
    The self function refere to the correct window, while window.close my be connected to the wrong (parent) window.
    input type="button" value="Cancel" onclick="self.close();"  id="CANCEL"Edited by: Sven W. on May 26, 2011 2:46 PM

  • Call smart form on button click

    Hi Experts,
    I have a screen. In screen a button is available. I need when i clicked on button my smartform should be open. Plz provide me ur appreciated solution.
    Regards,
    Swapniks

    Hi Swapnika,
    You forgot a small code in between.
    data: v_formname type tdsfname value 'zmem',
    v_fmname type rs381_fname
    Case sy-ucomm.
    when 'okbut'.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    FORMNAME = v_formname
    IMPORTING
    FM_NAME = v_fname
    call function v_fname.
    exporting
    pernr = itab-pernr.
    tables
    itab = itab.
    Regards,
    Prakash Pandey

  • Calling SAP Tcode on Button click

    Hello All,
    i want to call SAP Tcode on click of button.
    below is the code for the same,
    data l_componentcontroller type ref to ig_componentcontroller .
      data l_api_componentcontroller type ref to if_wd_component.
      data l_sapgui_manager type ref to cl_wdr_sapgui_integration.
      l_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
      l_api_componentcontroller = l_componentcontroller->wd_get_api( ).
      l_sapgui_manager = l_api_componentcontroller->get_sapgui_manager( ).
      if l_sapgui_manager is not initial.
        l_sapgui_manager->fire_start_transaction( transaction = 'SE38' ).
      endif.
    But the object l_sapgui_manager  is not getting instantiated. please let me know if i am calling the right method or  the code is wrong???
    Regrads,
    Chandra

    Hi Chandra,
    You need to Initialise the  l_sapgui_manager before you are accesing. see the folowing code i initialised my select options component.This code can be obtained from Wizard also. I hope this will help you.
    Please do this in the WDDOINIT of component controller. So that it will be inistatiated before you are accessing the component.
    ** initialize select options component for query creation
      lr_cmp_usage = wd_this->wd_cpuse_sel_options( ).
      wd_this->usage_name = lr_cmp_usage->name.
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      l_ref_interfacecontroller = wd_this->wd_cpifc_sel_options( ).
      wd_this->mr_selopt_helper   = l_ref_interfacecontroller->init_selection_screen( ).
    Warm Regards,
    Vijay.
    Message was edited by:
            Vijaya Bhaskarudu Gangisetty

  • Replacing default external w/ button click

    My container (emptyMC) will load 4 external movies and loop as
    default when someone comes to the site.
    Right now the code for the empty mc (emptyMC) is:
    var loader:MovieClipLoader = new MovieClipLoader();
    this.createEmptyMovieClip("emptyMC",1);
    loader.loadClip("image1.jpg",emptyMC);
    It loads the sample default image great.
    What needs to happen is when someone clicks Button1, Button2, Button3, or Button4,
    (which are movie clip buttons) the corresponding movie needs to load on the click of the button
    in the empty movie clip (emptyMC) and replace the default movie loop.
    Movie Loop default plays in "emptyMC" at entrance of site
    Button1 is clicked, Movie Loop default is replaced in "emptyMC" with Movie1
    Button2 is clicked, Movie Loop default is replaced in "emptyMC" with Movie2
    Button3 is clicked, Movie Loop default is replaced in "emptyMC" with Movie3
    Button4 is clicked, Movie Loop default is replaced in "emptyMC" with Movie4
    These are all external files.
    Thank you so much.

    The image will load but I lose the down state with the filled box indicating the current selection.
    Here's how the button mc is:
    On the main stage there's 4 button mc's (Button1, Button2, Button3 Button4)
    They are all on the same frame.
    -double click to edit the movie clip-
    Layer 1
    Frame 1: box outline
    Frame 6: box outline w/ "x"
    Frame 11: box outline
    Classic Tween between each set of frames
    Layer 2
    A button with this code:
    on (release) {
        if (_root.Button1._currentframe == 6) {
            _root.Button1.gotoAndPlay(7);
        gotoAndPlay(2);
    on (release) {
        if (_root.Button2._currentframe == 6) {
            _root.Button2.gotoAndPlay(7);
        gotoAndPlay(2);
    on (release) {
        if (_root.Button3._currentframe == 6) {
            _root.Button3.gotoAndPlay(7);
        gotoAndPlay(2);
    on (release) {
        if (_root.Button4._currentframe == 6) {
            _root.Button4.gotoAndPlay(7);
        gotoAndPlay(2);
    and then
    stop(); (for Layer 1's Frame 1)
    stop(); (for Layer 1s Frame 6)
    gotoAndPlay(1); (for Layer 1s Frame 11)
    Classic Tween between each set of frames
    This is working great. I go to the main stage and add this code to the actions
    layer in frame 3:
    Button2.onRelease = function()
         loader.loadClip("image2.jpg",emptyMC);
    and I lose the down (filled box) state.
    I'm really lost...
    Thanks for helping me out.

  • Can't Make Firefox My Default Browser

    I like Safari just fine but I want to make Firefox my default browser, OK? OK. Good.
    Now then, how do I tell Safari to STOP being my default browser?
    I have Firefox installed on the Mac and in its preferences, it thinks it's the default browser.
    So I went to Safari's preferences to make sure it doesn't still think IT's the default browser, but it does. So I went to the "general" tab under preferences. I see "Safari" as the default browser. I click the drop-box to choose a different application. Only "Firefox" is not listed anywhere among the applications.
    I installed Firefox from one of those "hard drive" like icons on my desktop. It runs fine from an icon in the dock. But near as I can tell, it's not listed among the applications on "Macintosh HD/Applications" directory. I suspect getting it listed there is going to be the first step in solving my default browser problem.
    So, what do I have to do to get "Firefox" listed among my applications, and then what else do I have to do to get it to be the default browser?
    Thanks,
    --PS

    No problemo, sorry about that.
    There is also a "Firefox.dmg" file on my desktop... I can tell that's not a .app, but... what is it exactly?
    The .dmg file is a disk image file. That is the format a lot of programs you download will be in. Some open by themselves to reveal the .app file some you have to double click.
    Double click on the firefox.dmg file. That should bring up a window that has a file called firefox.app. Right click with your mouse if you have one and drag it to the applications folder in your finder window.
    If you do not use a mouse put your cursor over thefirefox.app file. Now hold down the trackpad button and the ctrl key. Now you can use the trackpad to drag the file to the applications folder and drop it there.
    I prefer to not have any programs on the desktop. I like to use the dock to hold my favorites. Then the ones I don't use very often I just open from the applications folder.

  • Recently, whenever I try to open Firefox, I get a dialog box: Exc in ev handl: TypeError: brw is undefined (JavaScript Application). Firefox is definitely my default browser

    Question
    Recently, whenever I try to open Firefox, I get a dialog box: Exc in ev handl: TypeError: brw is undefined (JavaScript Application). Firefox is definitely my default browser.
    After clicking OK Firefox opens.

    Doesn't work out for me either, so I keep it disabled, because it slows down the searches, and it won't stream its additions onto the pages after the first page of search results. Streaming or page zipping allows me to scroll down to the next page of search results without selecting the page number.

  • Default browser for Mail

    Hi everyone,
    I have Safari and FireFox browsers installed and use both but FireFox mostly. Is there a way I can make FireFox the default browser when I click on links in an e-mail.
    I have looked in Mail preferences and can not see anything that helps.
    Thanks in advance for any answers,
    Alan

    Hi Alan
    In the Firefox Preferencess > Main, at the bottom, Check to see if Firefox is the default browser, and click on Check Now. If it isn't then you can select it to be, and Mail will use whatever is the default browser.
    regards roam

Maybe you are looking for

  • ICal All Day Events

    Hi, Im experiencing problems viewing my month view, i run my business which is holiday lets, off my ICal. I mainly use my month view because i can see availability and communicate this to clients when the call up to book/check availability. My proble

  • Three of us ail fail to connect at the same time?

    Something is really wonky with iChat. There are three of us that video chat almost daily. All of a sudden none of us can connect! I mean literally overnight! No one has made changes to their system. These are three G5 macs in three separate locations

  • Playing a FLV-File in a projector.exe from a network shared folder failes

    We want to load and play FLV-Files while our project files (Projector.exe) and FLV-files are sitting on a network shared folder with UNC-Path access (\\FILESERVER\sharename\). The problem is, that the flv-files do not play. If the same application ru

  • Itunes and quicktime major problems...

    I can't get itunes to work at all and now quicktime's stopped functioning! I get the usual "Sorry for the inconvenience but itunes has encounted a problem and needs to close" every time I try and start it. I've installed quicktime from the main apple

  • Problem facing in partner rofile creation !

    After adding new message type in the partner profile...When i check it by cntr+f2 i am getting the warning as " No message control entry for the following entry " Will it affect my idoc processing ? can any one help !