Java Game Development #2 – Creating our JFrame

[ad_1]
Complete Java Game Development Course now available at my website

In this video we look at creating our JFrame aka the window that our game is played on. If you have any questions then be sure to leave a comment or contact me on twitter; realtutsgml. If you learned something then be sure to leave a like, comment, and favorite.

Have you ever wanted to create games? Have you ever gotten fed up with it being to difficult? Well now is the time to thank me and possibly subscribe because you have just found the channel for you! Game Maker Tutorials, Java Game Programming, Unity3D Tutorials, Batch, C++ and much much more! This is the channel for you, the one stop shop for an exploration of your hidden talent as a game developer. Unleash your potential and go wild with imagination when you finally figure out how to make any game you want!

Visit CodingMadeSimple for more exclusive tutorials and get the help you need to succeed as your very own indie game developer!

Follow me on twitter for exclusive content and interaction with me!

Game Maker Studio: Programming
Game Maker Studio: Tutorial
Java Programming
Game Programming
Game Tutorial
Programming Tutorial


Posted

in

by

Tags:

Comments

33 responses to “Java Game Development #2 – Creating our JFrame”

  1. Laser Bean Avatar

    Hey. Great tutorial. Ive got a question. How does the code reach the "run" method? (is it called method?) I don't understand that part and the part about the threads.

  2. Roof Camper Avatar

    why do i get this message when trying to run:

    Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at com.game.src.main.Game.main(Game.java:18)

  3. Daraka bulgaria Avatar

    do i need jvm (java virtual machine) to run the codes on eclipse

  4. Sayan Das Avatar

    Where did u learn all this from?

  5. SANAL CAMBAZ Avatar

    First of all thanks for the video. But you are teaching as we all know Java. In some parts of video, you should tell better.

  6. edvid Avatar

    Is the reason for not needing to call the method run(), because it automaticly does that when you implement Runnable?

  7. lexa sossa Avatar

    I dont know why but when I run it it Doesn't loop "RUNNING" even though it shows threads

  8. The gamer Avatar

    what is the importance of private thread thread; .????

  9. James Michael Kuizon Avatar

    What does frame.pack() does?

  10. Kyle Meade Avatar

    What is a thread in java, What is an object ( Referring to Game game = new Game (); ) , I know what Dimensions ARE though how do they work as well as what are the scale math stuff in it.

  11. MinezGio Avatar

    what does Game game = new game(); mean ?

  12. darrell6776 Avatar

    @RealTutsGML The .pack(); method automatically sizes the JFrame based on the size of the components. Example: Instead of writing frame.pack();
    Write: frame.setSize(Width, Height);
    Source: http://docs.oracle.com/javase/tutorial/uiswing/components/frame.html

  13. GiGo Avatar

    Can you make a java platformer tutorial?

  14. Michael Armstrong Avatar

    Dope tutorial. Subscribed!

  15. Darragh Walsh Avatar

    Does this work on JDK 8?

  16. Sterling H Avatar

    I tried to put "thread.join();" in my stop() method, but it didn't work. It said "thread cannot be resolved"

  17. NahAr's WorLD Avatar

    why my window Length size is too short ?

  18. spacepod100 Avatar

    this thread stuff is confusing

  19. Adam Brodin Avatar

    Wtf game.game = new game? WTF: dude

  20. AwesomeGuy10_ Avatar

    it shows working but only once it doesent loop

  21. Paridox Avatar

    It's not opening the window it says "a Java exception has occurred"

  22. Duphus Avatar

    Actually, frame.pack() sets the size to that of it's contents.

  23. FreddyPaperview Avatar

    frame.pack(); causes this Window to be sized to fit the preferred size and layouts of its subcomponents. The resulting width and height of the window are automatically enlarged if either of dimensions is less than the minimum size as specified by the previous call to the setMinimumSize method.

    If the window and/or its owner are not displayable yet, both of them are made displayable before calculating the preferred size. The Window is validated after its size is being calculated.

  24. Brains & Balls Engineering Avatar

    Best java tutorial EVER
    you show us everything, explain everything, AND, THE BEST PART, GET THE SAME ERRORS AS US :DDDDDD

  25. Omar Atiye Avatar

    For me it doesn't show "WORKING" in the console but it works!

  26. GLStudios100 Avatar

    Why does my run method not run? I implemented Runnable, but there is still no output.

  27. Elvis Smiltnieks Avatar

    There is something wrong with Dimension

            Game game = new Game();

            game.setPreferredSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
            game.setMaximumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
            game.setMinimumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));

  28. zoyeb shaikh Avatar

    frame.pack() is for void window 

Leave a Reply

Your email address will not be published. Required fields are marked *