Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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 1804 times)
0 Members and 1 Guest are viewing this topic.
Offline Karmington

Senior Member


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.
http://www.jguru.com/faq/view.jsp?EID=567282
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 http://www.slicksandslide.com/,
pressing 'Aloita Peli' launches the applet, FI/EN flags change language

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

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


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

see http://www.quackit.com/html/codes/html_popup_window_code.cfm
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 Member


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: http://www.gokgs.com/
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.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
popFrame.setSize(800, 600);

panel = new SlicksPanel();
panel.setSize(800, 600);
      
popFrame.add(panel);
popFrame.setVisible(true);
panel.init();
panel.requestFocusInWindow();

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 Member


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?

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
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 Member


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);
frame.add(panel);
frame.setVisible(true);

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. http://www.metaportaldermedienpolemik.net/processing.org/applet_resize/ (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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (38 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (42 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (61 views)
2014-09-21 02:42:18

BurntPizza (31 views)
2014-09-21 01:30:30

moogie (36 views)
2014-09-21 00:26:15

UprightPath (49 views)
2014-09-20 20:14:06

BurntPizza (53 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!