Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 21st, 2006, 11:57 PM   #1
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
Clear screen with Java

I'm working on a graphing calculator for java and i need to clear the screen. I did a search in google "Clear screen for Java" and all the posts say "This isn't an easy task. One source says to "First import the windows api and run this procedure that he created". Come on there must be some easier way like "clearscreen()" isn't there please help me. Some of my friends have used clear screen in the past and i know that it didn't involve the windows api.
Eric the Red is offline   Reply With Quote
Old Feb 22nd, 2006, 1:14 AM   #2
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 856
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
You need to be more specific about what you want to do. What does "clear the screen" mean?
titaniumdecoy is offline   Reply With Quote
Old Feb 22nd, 2006, 2:32 AM   #3
pal
Programmer
 
pal's Avatar
 
Join Date: Mar 2005
Location: Washington
Posts: 90
Rep Power: 4 pal is on a distinguished road
Yea, I understand, there is System("cls"); for c++,
but I am not sure on how Java clears the screen.
It is odd that there isn't a straightforward descriptions on the web.
pal is offline   Reply With Quote
Old Feb 22nd, 2006, 7:17 AM   #4
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 3 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
why would you want to clear the screen for a graphing calculator anyways?
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Feb 22nd, 2006, 2:43 PM   #5
oNe8
Newbie
 
oNe8's Avatar
 
Join Date: Jan 2006
Posts: 17
Rep Power: 0 oNe8 is on a distinguished road
What is "the screen", like the object type, Almost every swing object has a method to either dispose of it or clear it.
oNe8 is offline   Reply With Quote
Old Feb 22nd, 2006, 3:08 PM   #6
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 856
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
I assume you are talking about clearing the console.

This is possible, but not easy. You will need to use JNI.

Here is a tutorial on how to clear the console and set color and cursor position.

You might find some of the comments at the bottom of this page helpful as well.

If that is too much work, you could just print "\n" enough times to clear the screen...

Last edited by titaniumdecoy; Feb 22nd, 2006 at 3:22 PM.
titaniumdecoy is offline   Reply With Quote
Old Feb 22nd, 2006, 7:29 PM   #7
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
Just got back

Well i'm drawing a parabala and cubic curve. Using "drawOval" in a loop. I spoke to my friends and they say just use c.clear(); and 'c' is the console.
Eric the Red is offline   Reply With Quote
Old Feb 22nd, 2006, 9:18 PM   #8
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 3 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
Quote:
Originally Posted by titaniumdecoy
If that is too much work, you could just print "\n" enough times to clear the screen...
lol thats what I'm talking about! lol
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Feb 22nd, 2006, 9:30 PM   #9
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
i'm just importing "import hsa.Console;"


and c.clear(); seems to be working. Anyone know why there is such a debate over something so simple?
Eric the Red is offline   Reply With Quote
Old Feb 22nd, 2006, 10:28 PM   #10
andro
Professional Programmer
 
Join Date: Oct 2005
Location: California
Posts: 312
Rep Power: 3 andro is on a distinguished road
Send a message via AIM to andro
hsa.Console is not a standard java package.
andro is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC