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 making a small game

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with making a small game

    hello ,
    i'm trying to make a small game ,
    i never done this before and got mixed up in the menus
    i tried to make a background image and it worked
    now i'm trying to put a jbutton on the background picture
    and it won't show i'm guessing it's not on top
    any ideas how to solve it ?

    here's what i did to get the background image
     
    public class Main extends javax.swing.JFrame {
     
        /**
         * Creates new form Main
         */
        public Main() {
           initComponents();
           jToggleButton1.setVisible(true);
     
           Dimension d= java.awt.Toolkit.getDefaultToolkit().getScreenSize();
           this.setExtendedState(Main.MAXIMIZED_BOTH);
           ImageIcon icon = new ImageIcon("images/c.jpg");
           Image image = icon.getImage();
           image = getScaledImage(image ,d.width ,d.height);
           icon.setImage(image);
           JLabel pic = new JLabel(new ImageIcon(image));      
           this.setContentPane(pic);
           this.pack();
        }

    thanks to all helpers !


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Help with making a small game

    The posted code does not compile without errors.
    Can you make a small simple program that compiles, executes and shows the problem?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Making a New Game Help
    By AndyLun in forum Java Code Snippets and Tutorials
    Replies: 2
    Last Post: December 5th, 2012, 03:25 AM
  2. Making Game, Need 1-3 People That Know JAVA
    By Stilez in forum Paid Java Projects
    Replies: 2
    Last Post: August 27th, 2012, 02:51 PM
  3. Game for Small Children Program
    By Javazoid in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 29th, 2012, 03:02 PM
  4. Making a Craps game.
    By SOK in forum Object Oriented Programming
    Replies: 1
    Last Post: March 6th, 2010, 08:23 PM
  5. Theory behind 2d Game making?
    By DarrenReeder in forum Java Theory & Questions
    Replies: 3
    Last Post: January 28th, 2010, 02:54 AM