Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • `Discardedx2`: ?
      September 21, 2018, 12:24:09 PM
    • Pookey71: ARE YOU HERE TO RECEIVE MY LIMP PENIS!?
      September 20, 2018, 11:55:24 PM
    • Pookey71: THIS IS DEMOCRACY MANIFESTO
      September 20, 2018, 11:55:07 PM
    • Vasi28: Гранд
      September 03, 2018, 07:06:22 PM
    • Rash: test
      August 30, 2018, 09:09:18 PM
    • Guruu:[link]
      August 30, 2018, 12:04:45 AM
    • Guruu: am i allowed to post links shoutbox?
      August 30, 2018, 12:03:46 AM
    • drubrkletern:[link] feedback wanted
      August 28, 2018, 03:55:17 PM
    • bugz000: Anyone got a link for the old ass silab client and cache.zip? from mopar 3.2 era :) 317
      August 25, 2018, 12:48:15 AM
    • cholland2015: Does anyone know where I can download the old moparscape client/server?
      August 24, 2018, 02:30:51 PM
    • hexedss1: Anyone would like to help on client side got a variable declartion Error
      August 15, 2018, 09:06:30 PM
    • SOUPSOUP: just get a vpn
      August 13, 2018, 06:44:28 PM
    • jme: _^_ will answer all of your javascript questions
      August 12, 2018, 07:11:00 PM
    • doomsale: and where is boxman?
      August 10, 2018, 03:16:59 AM
    • doomsale: Where can i play the Moparscape MMORPG with the Metallica instrumentals?
      August 10, 2018, 03:16:47 AM
    • doomsale: no longer clicking on doors and dummies at east bank
      August 10, 2018, 03:16:07 AM
    • doomsale: were all grown up now huh?
      August 10, 2018, 03:15:58 AM
    • _^_: hey everyone look at my graphs [link]
      August 06, 2018, 01:52:16 PM
    • braedyn: Someone pl0x help me out with PI Lottery!!
      August 03, 2018, 02:12:25 AM
    • Travas: p3n1s
      July 26, 2018, 09:46:33 PM

    Author Topic: How can I achieve this?  (Read 731 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineLimits

    • Member
    • ****
    • Posts: 2,190
    • Thanks: +0/-0
      • View Profile
    How can I achieve this?
    « on: July 15, 2014, 01:16:43 PM »
    Hey. So how can I make a game frame similar to RuneScape where there is a solid frame all around and the actual game view is located in a specific area. I'd like to know if it's possible to do this by putting the game on a JPanel that is within the game's JFrame
    Runescape Gambling

    Offlineohokay

    • Member
    • ****
    • Posts: 1,214
    • Thanks: +0/-0
      • View Profile
    Re: How can I achieve this?
    « Reply #1 on: July 15, 2014, 01:25:45 PM »
    Yes that's how you do it, the applet/game goes into a JPanel which is added to the frame
    I don't think sk8r could be wrong because he is a god, But what do i need to do then?
    Runescape Gambling

    OfflineLimits

    • Member
    • ****
    • Posts: 2,190
    • Thanks: +0/-0
      • View Profile
    Re: How can I achieve this?
    « Reply #2 on: July 15, 2014, 01:26:50 PM »
    Yes that's how you do it, the applet/game goes into a JPanel which is added to the frame


    May you please explain or give an example to how that is done? My brain is fried, I've been trying for an hour
    Runescape Gambling

    OfflineJustin Bieber

    • Member
    • ****
    • Posts: 2,941
    • Thanks: +0/-0
      • View Profile
    Re: How can I achieve this?
    « Reply #3 on: July 15, 2014, 02:12:02 PM »
    It's all done by your own rendering code within the panel surely? JFrame just represents the window..

    OfflineLimits

    • Member
    • ****
    • Posts: 2,190
    • Thanks: +0/-0
      • View Profile
    Re: How can I achieve this?
    « Reply #4 on: July 15, 2014, 06:21:59 PM »
    It's all done by your own rendering code within the panel surely? JFrame just represents the window..


    It renders onto the JFrame and the JFrame class has methods that the JPanel class does not.

    Offlinewildskiller

    • Member
    • ****
    • Posts: 1,435
    • Thanks: +0/-0
      • View Profile
    Re: How can I achieve this?
    « Reply #5 on: July 15, 2014, 09:45:56 PM »
    I use a canvas, but everyone has their preferences.

    To use a JPanel, just override the paint(Graphics) method and add it to the window. You could create a buffer strategy using the Canvas class and add it to the window.
    « Last Edit: July 15, 2014, 09:47:50 PM by wildskiller »

    OfflineLimits

    • Member
    • ****
    • Posts: 2,190
    • Thanks: +0/-0
      • View Profile
    Re: How can I achieve this?
    « Reply #6 on: July 15, 2014, 09:47:58 PM »
    I use a canvas, but everyone has their preferences.
    I swapped to a canvas. Does it work for you?

    Offlinewildskiller

    • Member
    • ****
    • Posts: 1,435
    • Thanks: +0/-0
      • View Profile
    Re: How can I achieve this?
    « Reply #7 on: July 15, 2014, 09:50:09 PM »
    I use a canvas, but everyone has their preferences.
    I swapped to a canvas. Does it work for you?
    Yes, just as I edited in my post, you can use a buffer strategy.

    OfflineLimits

    • Member
    • ****
    • Posts: 2,190
    • Thanks: +0/-0
      • View Profile
    Re: How can I achieve this?
    « Reply #8 on: July 15, 2014, 10:23:51 PM »
    I use a canvas, but everyone has their preferences.
    I swapped to a canvas. Does it work for you?
    Yes, just as I edited in my post, you can use a buffer strategy.
    Aha! Got it working, thank you!

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal