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 3 of 3

Thread: JFrame Menu Screen(For my game)?

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default JFrame Menu Screen(For my game)?

    Hey, i am trying to make a start up menu for my game although im not sure how i do thing exactly. A idea which i had, was that i could make a Start up screen with paint with a start button although the problem that i have found with this idea is that...I cant add a action for listener for a Image (drawImage to draw 'start' button), although i suspect somthing to do with Rectangles and bounds are too do with this...

    Another problem i have is that im not sure how i can start the game from no where (if u know wat i mean?)...on my current games, i just have a JFrame which adds the JPanel on the main method, then everything goes from there...

    Well, somthing that i did to test it out myself was.. I made a blank JPanel which gets added to the JFrame on the main method, then i made it so when mouseCicked, the second JPanel gets added to the Frame class...

    (so like.. Frame f = new Frame(); (Frame.class has JFrame), then f.add(new Board()), and Board is the game starting class..)...

    Although this isnt working, it just stays on the ucrrent JPanel and the game doesnt start...


    So if anyone can hekp, thanks in advance!!!


  2. #2
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: JFrame Menu Screen(For my game)?

    bump------

  3. #3
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: JFrame Menu Screen(For my game)?

    How to Use Menus (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)

    db

Similar Threads

  1. Replies: 4
    Last Post: July 20th, 2010, 07:15 AM
  2. my menu doesnt work can u tell me whats wrong
    By claymore in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 8th, 2010, 04:16 AM
  3. ArrayList and making a Menu
    By Silver in forum Collections and Generics
    Replies: 2
    Last Post: January 28th, 2010, 03:29 AM
  4. Help - Return to menu screen
    By throzen in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 29th, 2009, 01:44 PM
  5. Building a Menu List
    By websey in forum AWT / Java Swing
    Replies: 1
    Last Post: November 15th, 2009, 10:34 AM