Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (616)
Games in Android Showcase (173)
games submitted by our members
Games in WIP (659)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Launching applet/application in new window  (Read 2181 times)
0 Members and 1 Guest are viewing this topic.
Offline Karmington

Senior Devvie

Medals: 1
Projects: 1

Co-op Freak

« Posted 2009-08-25 14:37:11 »

Hi again fellows. Game is advancing nicely, but another little bump on the road is slowing me down:

I would like to open the applet in a new window, to allow the user to resize at will.
How is this done? Have been googling for days and only one link so far, which is however not doing what i want.
With that I can get a new Tab to open (firefox and opera), after getting the popup blocker notification.
Please enlighten me...

The game can be checked out at,
pressing 'Aloita Peli' launches the applet, FI/EN flags change language

My model is the gokgs server, which handles this very nicely.

Online kappa
« League of Dukes »

JGO Kernel

Medals: 96
Projects: 15


« Reply #1 - Posted 2009-08-25 14:45:19 »

Offline JL235

JGO Coder

Medals: 10

« Reply #2 - Posted 2009-08-26 01:02:28 »

As a workaround, you could start the applet in it's current window and then have the applet create a new JFrame.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Karmington

Senior Devvie

Medals: 1
Projects: 1

Co-op Freak

« Reply #3 - Posted 2009-08-27 13:52:46 »

ok, the quackit code makes a beautiful popup new window, but - of course it is the browser window, not the java window
so it doesnt react to resizing... otherwise quite workable.
JFrame ends up doing nearly the same thing, no dynamic resize, just makes a new frame inside the window.
Thank you for the ideas all the same!

Ok my wording is wrong - i guess it's not a browser window, it's a java (application?)
launched from the browser window...
there must be an easy way:
They seem to know how to do this.
You login, then it pops open a movable, resizable game lobby ON TO THE WORKSPACE. How do they do it?

I tried to make the new JFrame like so, from inside the main applet:

popFrame = new JFrame("pop");
popFrame.setSize(800, 600);

panel = new SlicksPanel();
panel.setSize(800, 600);

but it does not make a window on the workspace, it is still inside the browser.

Offline h3ckboy

JGO Coder

Medals: 5

« Reply #4 - Posted 2009-08-27 14:25:20 »

you could try JFrame.setResizable(true); just a thought...
Offline Karmington

Senior Devvie

Medals: 1
Projects: 1

Co-op Freak

« Reply #5 - Posted 2009-08-27 14:35:39 »

tried that, still no go. Maybe I'm missing something, like are they launching a separate application or something?

Online kappa
« League of Dukes »

JGO Kernel

Medals: 96
Projects: 15


« Reply #6 - Posted 2009-08-27 14:55:07 »

in case you missed this, an applet will automatically resize to fit the window it is in if you use the "%" symbol in the applet tag.

<applet ... width=100% height=100%>
Offline Karmington

Senior Devvie

Medals: 1
Projects: 1

Co-op Freak

« Reply #7 - Posted 2009-08-27 16:19:51 »

Ok, I was a bit slow on the uptake, now getting all possible´s:

JFrame, movable window with disadvantage of a grey warning arrow

SlicksPanel panel = new SlicksPanel();
panel.setSize(width, height);      
JFrame frame = new JFrame();
frame.setSize(width, height);

so simple after all.

JWindow, undecorated gfx whatever screen can give
I can make as big an applet as i want, within the browser window.
I might even be able to resize it at will Inside a specific preset area. (very cool, but difficult)
I can pop new browser windows

quite impressive array of choices when we get down to it.

But if we look at the gokgs implementation, it is definitely the most natural, as it opens a normal window containing the app on to the desktop.
[CORRECTION] gokgs does indeed have the warning sign, just havent noticed it before :p
thanks anyhows everybody, it was surprisingly hard to find any examples which pop JFrames for the user so i was a bit confused as to how it was done.

P.S. Nothing works on Opera anymore.... ayay.lucky it's still not very popular

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Coldstream24 (19 views)
2015-09-03 00:41:28

Andrew_3ds (31 views)
2015-09-01 19:08:10

afikri (20 views)
2015-08-31 09:30:22

afikri (27 views)
2015-08-31 09:30:07

afikri (15 views)
2015-08-31 09:27:24

afikri (17 views)
2015-08-31 09:26:40

Roquen (32 views)
2015-08-29 11:30:54

GamerC4 (41 views)
2015-08-22 20:38:50

GamerC4 (37 views)
2015-08-22 20:37:18

GamerC4 (43 views)
2015-08-22 20:37:01
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!