Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: HELP with my JMenuItem opening a URL.

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default HELP with my JMenuItem opening a URL.

    so i have this JMenuItem in JMenuBar.
    what i want is to make a URL(website) open when someone clicks the JMenuItem.

    my JMenuItem is "home".
    how do i make it open a URL when it's clicked?

    code:

    				if(e.getSource()==home){
    					JOptionPane.showMessageDialog(null, "This is still being added!", "OOPS!", JOptionPane.WARNING_MESSAGE);
     
    			}


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: HELP with my JMenuItem opening a URL.

    What did you try?
    What happened?

Similar Threads

  1. JMenuItem action Listener
    By WackoMako in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 11th, 2012, 12:59 PM
  2. How to change color of JMenuItem when mouse is over it
    By Bagzli in forum AWT / Java Swing
    Replies: 5
    Last Post: April 2nd, 2012, 02:09 PM
  3. Getting an error when opening a new Window through a JMenuItem
    By !Marcus in forum Java Theory & Questions
    Replies: 3
    Last Post: December 31st, 2011, 07:51 PM
  4. Listening to JMenuItem keyboard focus
    By nik_meback in forum AWT / Java Swing
    Replies: 0
    Last Post: December 31st, 2010, 04:02 AM