open new undecorated window

Hey

I got this Java applet I want to be opened in an undecorated frame (not full screen).
I understand I must do this with JavaScript when opening the window but I am not sure how to get rid of the titlebar etc or if its even possible.
It should look equivalent to a java application where Id set "frame.setUndecorated(true);"
Meaning no titlebar, no borders, no nothing - only the content. (the ability to drag it around and max,min,close buttons I will fix with Java)

snabbenAsked:
Who is Participating?
 
ZylochConnect With a Mentor Commented:
Looks to be that way--it's what endears Mozilla to us all

You could use a layer like Xxavier shows, in a <div> ;)
0
 
ZylochCommented:
Hi snabben,

As good as it's going to get for Mozilla:
http://www.mozilla.org/docs/dom/domref/dom_window_ref76.html

For IE, you can use createPopup(), but this is more recommended:
http://www.dynamicdrive.com/dynamicindex8/chromeless.htm

Unfortunately, this doesn't work well with any SPs.


Therefore, you might want to check out createPopup() for IE:
http://www.webreference.com/js/tips/000523.html

Regards,
Zyloch
0
 
XxavierCommented:
something like this might work ie an iframe on adraggable layer, you can add buton to set the layer invisible/visible and unload/load the iframe

<script>
var concernedLayers=new Array()
concernedLayers[0]=new Array("aName",300,50)
//syntax is: entry[x]=new Array(LAYERName, its_WIDTH, its_HEIGHT)
//you can go on with indexes [1], [2]...
var engagedZindex=0;
var engaged=null;

//DOM detected build up:
if(document.getElementById){
obj1="document.getElementById('"
obj2="')"
style=".style"
eX=(navigator.appName.indexOf("Internet Explorer")==-1)?
"e.clientX":"event.clientX";
eY=(navigator.appName.indexOf("Internet Explorer")==-1)?
"e.clientY":"event.clientY";
offsetX=(navigator.appName.indexOf("Internet Explorer")==-1)?
"pageXOffset":"document.body.scrollLeft"
offsetY=(navigator.appName.indexOf("Internet Explorer")==-1)?
"pageYOffset":"document.body.scrollTop"
}
else if(document.all){
obj1="document.all['"
obj2="']"
style=".style"
eX="event.clientX"
eY="event.clientY"
offsetX="document.body.scrollLeft"
offsetY="document.body.scrollTop"
}
else if(document.layers){
obj1="document.layers['"
obj2="']"
style=""
eX="e.pageX"
eY="e.pageY"
offsetX="pageXOffset"
offsetY="pageYOffset"
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP)
}
//DOM build up now over

function events(e){//argument must be set as e
var Xin=eval(eX)
var Yin=eval(eY)
/*thanks to Dynamic HTML by Danny Goodman for
settings of following looping idea*/
for(var i=0;i < concernedLayers.length;i++){
var OGG=eval(obj1+concernedLayers[i][0]+obj2+style);
//is it visible?:
var visib=OGG.visibility
if(visib=="hidden"||
visib=="hide"){continue}
var layerW=concernedLayers[i][1]
var layerH=concernedLayers[i][2]
var L=parseFloat(OGG.left);//parseFloat: could carry a trailing "px" !
var T=parseFloat(OGG.top)
var offX=(document.layers)?0:eval(offsetX);//in case you scrolled
var offY=(document.layers)?0:eval(offsetY)
if(
Xin>(L-offX)&&Xin < (L-offX+layerW)&&
Yin>(T-offY)&&Yin < (T-offY+layerH))
{engaged=i;
moveX=Xin-L
moveY=Yin-T
engagedZindex=OGG.zIndex
setIndex(concernedLayers[i][0])
return}
}
engaged=null
/*keep this comment to reuse freely
http://www.unitedscripters.com */}

function setIndex(theLayer,how){
var OGG=eval(obj1+theLayer+obj2+style)
OGG.zIndex=(how)?how:101;
}

function disengage(){
if(engaged==null){return false}
setIndex(concernedLayers[engaged][0],engagedZindex)
moveX=null;
moveY=null;
engaged=null;
}

function dragLayer(e){
if(engaged==null){return false}
var Xin=eval(eX)
var Yin=eval(eY)
var OGG=eval(obj1+ concernedLayers[engaged][0]+ obj2+ style)
//now move it
OGG.top=Yin-moveY
OGG.left=Xin-moveX
/*keep this comment to reuse freely
http://www.unitedscripters.com */}

document.onmousedown=events
document.onmousemove=dragLayer
document.onmouseup=disengage
</script>

<html>

<head>
<title>New Page 1</title>
</head>

<body>
<div id="aName"
style="position:absolute;left: 40;top: 40;z-index: 3;display:block;width: 400;height: 420;background-color: #ffffff;background-layer-color: #ffffff;color:#000000;padding: 2;border-style: solid;border-width: 2;border-color: #0000ff">
&nbsp;<br>
<IFRAME src="http://google.com" height=400 width=400></IFRAME>
</div>

</body>
</html>
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
snabbenAuthor Commented:
Xxavier: I still got titlebar, close button etc though .. thats what I want to get rid of, and itll still be there if i set the layer invisible right? Its a nice code though!

Zyloch: So you're basically saying that, in Mozilla, I can't get what I want. I tried without having anything set except height and width, and the result was that I still had titlebar and X _ buttons
0
 
snabbenAuthor Commented:
Okay, thanks for the answers, Ill split the points to you guys!
0
 
XxavierCommented:
snabben, the div idea is that the page behind is an opening page say a link to open the  applet by changing the visbility, looks like a new window but is'nt. The title bar belongs to the opening page as it where.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.