Any way to create a border around the Window in Screen mode?

53 views
Skip to first unread message

johnnar...@gmail.com

unread,
Feb 26, 2015, 10:34:38 PM2/26/15
to lanterna...@googlegroups.com
Hi, Martin,

I'm using Screen Mode (currently 2.1.7) and the resultant window is frameless (visually speaking) - i.e., the text content extends all the way to the edges (top, bottom, left, right) of the window.

Is there any way to create a "border" around that window, to set it off from the other windows and/or the desktop background?

If such a border were in place, then Lanterna would need to be aware of and respect its presence.

Thanks!

-- John

Martin Berglund

unread,
Mar 8, 2015, 12:01:50 AM3/8/15
to lanterna...@googlegroups.com
Hi John,
I'm not exactly sure what you mean by frameless, could you send a screenshot please?

Thanks,
Martin

--
Det här meddelandet skickas till dig eftersom du prenumererar på gruppen "lanterna-discuss" i Google Grupper.
Om du vill sluta prenumerera på den här gruppen och inte längre få någon e-post från den skickar du ett e-postmeddelande till lanterna-discu...@googlegroups.com.
Fler alternativ finns på https://groups.google.com/d/optout.

John N Armstrong

unread,
Mar 8, 2015, 7:47:26 PM3/8/15
to lanterna...@googlegroups.com

Sure. I've included a screenshot (below) of the window (green on black) on a white desktop background. As you can see, there is not "border" around the window; the content extends completely to the edge.

Note that this is on a Mac (10.10 - Yosemite). It displays exactly the same on Ubuntu 10.14 - no border around the window.

However, interestingly enough, it doesn't appear this way on Windows - on Windows, the Lanterna window has a border around it (presumably added by Windows?)

Thanks,


 John N Armstrong

Mac: It just works.

"A dog and a truck - what more do you need?"


John N. Armstrong
830 Carrington Greens Drive
Frisco, TX 75034-3456
Mobile: 972-529-0195








Det här meddelandet skickas till dig eftersom du prenumererar på ett ämne i gruppen "lanterna-discuss" i Google Grupper.
Sluta prenumerera på det här ämnet genom att besöka https://groups.google.com/d/topic/lanterna-discuss/cKip_dGU9WA/unsubscribe.
Om du vill sluta prenumerera på den här gruppen och på alla ämnen i den skickar du ett e-postmeddelande till lanterna-discu...@googlegroups.com.

AvL42

unread,
Mar 8, 2015, 8:34:31 PM3/8/15
to lanterna...@googlegroups.com
Your presumption is entirely correct.  The border is added by the Windowmanager.  I'm using IceWM on my machines (I dislike unity), and it does show borders on lanterna windows.

In other words: these borders aren't Lanterna's responsibility.

PS: if you really want borders, then either you can configure your mac to show them, or "Mac: It just works." just doesn't work for you ;-)

John N Armstrong

unread,
Mar 9, 2015, 9:22:31 AM3/9/15
to lanterna...@googlegroups.com

You are correct, sir - windows on a Mac are "borderless", which makes the Lanterna window consistent with all other Mac windows. Apparently, the same is true of my Ubuntu install, too.

And yes, I was unaware that Windows adds a border to windows by default.

However, I guess I was under the mistaken impression that the application (via Swing) could add a border to the application's main window.

Thanks for enlightening me!


P.S. LOL: "'Mac: It just works.' just doesn't work for you." Good one!




 John N Armstrong

Mac: It just works.

"A dog and a truck - what more do you need?"










AvL42

unread,
Mar 9, 2015, 10:00:01 AM3/9/15
to lanterna...@googlegroups.com
In 3.0.0 you'd have a choice between using a SwingTerminalFrame (JFrame) or SwingTerminal (JComponent).
One of them (I don't remember which) you could instantiate and embed into another Swing Container of your own choice or coding to display a frame around the actual Lanterna-contents.

Also, you could draw a Border of line-drawing characters *inside* the Lanterna Screen, sacrificing 2 rows and 2 columns of the actual content.

Whatever you end up with, be aware that you do not know what windowmanager will end up managing the windows on users side, and whether that Windowmanager will draw an outer border or not. (there might be heuristics for MS-Windows or Mac, but Linux isn't always Ubuntu's unity.)
If you draw an extra inner border, then make sure it doesn't look too odd in combination with an outer border, where there happens to be one.

John N Armstrong

unread,
Mar 9, 2015, 10:06:28 AM3/9/15
to lanterna...@googlegroups.com
Thanks for the suggestions.

Yes, indeed. One needs to be careful about making assumptions as what looks "good" on one platform may not look at all "right" on another.

And, after all, cross-platform deployment is a major consideration in this particular application.



 John N Armstrong

Mac: It just works.

"A dog and a truck - what more do you need?"










Martin Berglund

unread,
Apr 4, 2015, 12:33:55 AM4/4/15
to lanterna...@googlegroups.com
I think it's possible to create a completely borderless Swing window, but in that case the titlebar will also go away and you'll have to implement some manual way of moving the window around. I think sticking to the default look and feel will be best, as it will hopefully deliver the most consistent appearance across platforms.

Thanks,
Martin

--
Det här meddelandet skickas till dig eftersom du prenumererar på gruppen "lanterna-discuss" i Google Grupper.
Om du vill sluta prenumerera på den här gruppen och inte längre få någon e-post från den skickar du ett e-postmeddelande till lanterna-discu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages