Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Clear Screen???

Reply
Thread Tools

Clear Screen???

 
 
zeus
Guest
Posts: n/a
 
      09-12-2005
How can i clear the screen in java?

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      09-12-2005
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
 
 
 
 
Thomas Hawtin
Guest
Posts: n/a
 
      09-12-2005
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
 
Roedy Green
Guest
Posts: n/a
 
      09-12-2005
On 11 Sep 2005 19:29:04 -0700, "zeus" <(E-Mail Removed)> 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
 
Roedy Green
Guest
Posts: n/a
 
      09-12-2005
On Mon, 12 Sep 2005 04:14:36 +0100, Thomas Hawtin
<(E-Mail Removed)> 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
 
Steve Sobol
Guest
Posts: n/a
 
      09-12-2005
Roedy Green wrote:
> On Mon, 12 Sep 2005 04:14:36 +0100, Thomas Hawtin
> <(E-Mail Removed)> 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: http://www.velocityreviews.com/forums/(E-Mail Removed) Snail: 22674 Motnocab Road, Apple Valley, CA 92307
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      09-12-2005
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
 
gerrards8@yahoo.com
Guest
Posts: n/a
 
      09-13-2005
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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox - Clear History? Paull Firefox 7 08-24-2012 04:49 PM
Response.Clear() doesn't clear David ASP .Net 2 01-31-2008 08:32 PM
Unrecognized element 'add' after <clear></clear> InvalidLastName ASP .Net Web Services 3 03-06-2007 03:07 AM
How Do I Clear search items? Wabby Wabusha Firefox 1 10-26-2004 08:36 PM



Advertisments