Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - Clear Screen???

 
Thread Tools Search this Thread
Old 09-12-2005, 02:29 AM   #1
Default Clear Screen???


How can i clear the screen in java?



zeus
  Reply With Quote
Old 09-12-2005, 02:49 AM   #2
Andrew Thompson
 
Posts: n/a
Default Re: Clear Screen???

On 11 Sep 2005 19:29:04 -0700, zeus wrote:

> How can i clear the screen in java?


Java is better suited to working within the current
screen environment, rather than clearing it.

What do you intend to happen to the 'task bar' and
other opened programs when this action happens?

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Seen you on Aldebaran, safe on the green desert sand"
The Rolling Stones '2000 Light Years From Home'
  Reply With Quote
Old 09-12-2005, 03:14 AM   #3
Thomas Hawtin
 
Posts: n/a
Default Re: Clear Screen???

Andrew Thompson wrote:
> On 11 Sep 2005 19:29:04 -0700, zeus wrote:
>
>
>>How can i clear the screen in java?

>
>
> Java is better suited to working within the current
> screen environment, rather than clearing it.
>
> What do you intend to happen to the 'task bar' and
> other opened programs when this action happens?


i wanted it turn black

import java.awt.*;

class ClearScreen {
public static void main(String[] args) {
try {
for (
GraphicsDevice device :
GraphicsEnvironment
.getLocalGraphicsEnvironment()
.getScreenDevices()
) {
if (device.isFullScreenSupported()) {
Window window = new Window(null);
window.setBackground(Color.BLACK);
device.setFullScreenWindow(window);
}
}
Thread.sleep(10000);
} catch (java.lang.InterruptedException exc) {
// Ignore.
} finally {
System.exit(0);
}
}
}


--
Unemployed English Java programmer
http://jroller.com/page/tackline/
  Reply With Quote
Old 09-12-2005, 03:33 AM   #4
Roedy Green
 
Posts: n/a
Default Re: Clear Screen???

On 11 Sep 2005 19:29:04 -0700, "zeus" <> wrote or
quoted :

>How can i clear the screen in java?

to clear the console log see http://mindprod.com/jgloss/console.html

It is not your real estate. At best you can close frames to reveal
what was under them.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
  Reply With Quote
Old 09-12-2005, 03:35 AM   #5
Roedy Green
 
Posts: n/a
Default Re: Clear Screen???

On Mon, 12 Sep 2005 04:14:36 +0100, Thomas Hawtin
<> wrote or quoted :

>i wanted it turn black


IF you want the screensaver hook to temporarily draw something else,
then later restore the original screen, you would do that in C/C++ and
link to it via JNI.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
  Reply With Quote
Old 09-12-2005, 03:58 AM   #6
Steve Sobol
 
Posts: n/a
Default Re: Clear Screen???

Roedy Green wrote:
> On Mon, 12 Sep 2005 04:14:36 +0100, Thomas Hawtin
> <> wrote or quoted :
>
>
>>i wanted it turn black

>
>
> IF you want the screensaver hook to temporarily draw something else,
> then later restore the original screen, you would do that in C/C++ and
> link to it via JNI.


Google for saverbeans - I believe it's part of the Java Desktop Integration
Components project. It allows you to write native screensavers in Java. That
approach will work much better...

Of course, I'm assuming that the OP wants to create a screensaver, which
wasn't clear from the original post.

--
Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
Company website: http://JustThe.net/
Personal blog, resume, portfolio: http://SteveSobol.com/
E: Snail: 22674 Motnocab Road, Apple Valley, CA 92307
  Reply With Quote
Old 09-12-2005, 07:38 AM   #7
Andrew Thompson
 
Posts: n/a
Default Re: Clear Screen???

On Sun, 11 Sep 2005 20:58:42 -0700, Steve Sobol wrote:

> Google for saverbeans -


<https://screensavers.dev.java.net/>

E.G.s
<http://www.javasaver.com/testjs/xsl/03/starzoom.xml>
<http://www.javasaver.com/testjs/xsl/03/globespinner.xml>
<http://www.javasaver.com/testjs/xsl/03/firesaver.xml>

>...I believe it's part of the Java Desktop Integration
> Components project.


As I understand, it might *become* part of that, but as an
incubator project, it is not yet part of it.

Further, it supports Win and Unix, but not Mac.,
and cannot become part of the integration components
until/unless it does support Mac.

>..It allows you to write native screensavers in Java.


It actually just provides the 'native hooks' into the
OS' own screensaver system. The code you write for the
savers can still be plain ole' Java.

[ And I am not sure if what I said was functionally
different from what you wrote. ]

>..That
> approach will work much better...
>
> Of course, I'm assuming that the OP wants to create a screensaver, which
> wasn't clear from the original post.


Same here. (not clear what OP wants)

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"My legs are aching, my eyes are sore. I haven't washed my jeans in 3
months or more.."
Magic Dirt 'Dirty Jeans (Single Version)'
  Reply With Quote
Old 09-13-2005, 01:29 AM   #8
gerrards8@yahoo.com
 
Posts: n/a
Default Re: Clear Screen???

zeus wrote:
> How can i clear the screen in java?
>


If this is a console application (clear the screen), then check out this
article:
http://www.javaworld.com/javaworld/j...html#resources

and these curses libraries:
http://sourceforge.net/projects/javacurses/
http://www.pitman.co.za/projects/charva/
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump