![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 214
Rep Power: 0
![]() |
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.
|
|
|
|
|
|
#2 |
|
Expert Programmer
|
You need to be more specific about what you want to do. What does "clear the screen" mean?
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Mar 2005
Location: Washington
Posts: 90
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#4 |
|
Sexy Programmer
|
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! |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Jan 2006
Posts: 17
Rep Power: 0
![]() |
What is "the screen", like the object type, Almost every swing object has a method to either dispose of it or clear it.
__________________
http://img523.imageshack.us/img523/8436/user9kz.jpg |
|
|
|
|
|
#6 |
|
Expert Programmer
|
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. |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 214
Rep Power: 0
![]() |
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.
|
|
|
|
|
|
#8 | |
|
Sexy Programmer
|
Quote:
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
|
|
|
#9 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 214
Rep Power: 0
![]() |
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? |
|
|
|
|
|
#10 |
|
Professional Programmer
|
hsa.Console is not a standard java package.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|